static <T, V> ThrowingFunction<KV<T, V>, KV<T, String>> createToStringFunctionForPTransform(
      String ptransformId, PTransform pTransform) {
    return (KV<T, V> input) -> KV.of(input.getKey(), Objects.toString(input.getValue()));
  }
@Test
  public void testPrimitiveToString() throws Exception {
    String pTransformId = "pTransformId";

    SdkComponents components = SdkComponents.create();
    components.registerEnvironment(Environments.createDockerEnvironment("java"));
    RunnerApi.PTransform pTransform = RunnerApi.PTransform.newBuilder().build();

    ThrowingFunction<KV<String, Integer>, KV<String, String>> toStringFunction =
        ToStringFnRunner.createToStringFunctionForPTransform(pTransformId, pTransform);

    KV<String, Integer> input = KV.of("key", 12345);

    assertEquals(KV.of("key", "12345"), toStringFunction.apply(input));
  }