public static <InputT, OutputT> MapElements<InputT, OutputT> via(
      final InferableFunction<InputT, OutputT> fn) {
    return new MapElements<>(fn, fn.getInputTypeDescriptor(), fn.getOutputTypeDescriptor());
  }
@Test
  @Category(NeedsRunner.class)
  public void testMapSimpleFunction() throws Exception {
    PCollection<Integer> output =
        pipeline
            .apply(Create.of(1, 2, 3))
            .apply(
                MapElements.via(
                    new SimpleFunction<Integer, Integer>() {
                      @Override
                      public Integer apply(Integer input) {
                        return -input;
                      }
                    }));

    PAssert.that(output).containsInAnyOrder(-2, -1, -3);
    pipeline.run();
  }