public static <T> Global<T> globally() {
    return new Global<>();
  }
@Test
  @Category(NeedsRunner.class)
  public void testAggregateBaseValuesGlobally() {
    Collection<BasicEnum> elements =
        Lists.newArrayList(
            BasicEnum.of("a", BasicEnum.TestEnum.ONE), BasicEnum.of("a", BasicEnum.TestEnum.TWO));

    PCollection<Row> aggregate =
        pipeline
            .apply(Create.of(elements))
            .apply(
                Group.<BasicEnum>globally()
                    .aggregateFieldBaseValue("enumeration", Sum.ofIntegers(), "enum_sum"));
    Schema aggregateSchema = Schema.builder().addInt32Field("enum_sum").build();
    Row expectedRow = Row.withSchema(aggregateSchema).addValues(3).build();
    PAssert.that(aggregate).containsInAnyOrder(expectedRow);

    pipeline.run();
  }