public static String approximatePTransformName(Class<?> clazz) {
    checkArgument(PTransform.class.isAssignableFrom(clazz));
    if (clazz.getSimpleName().startsWith("AutoValue_")) {
      return approximatePTransformName(clazz.getSuperclass());
    }
    return approximateSimpleName(clazz, /* dropOuterClassNames */ false)
        .replaceFirst("\\.Bound$", "");
  }
@Test
  public void testPTransformName() {
    EmbeddedPTransform transform = new EmbeddedPTransform();
    assertEquals(
        "NameUtilsTest.EmbeddedPTransform",
        NameUtils.approximatePTransformName(transform.getClass()));
    assertEquals(
        "NameUtilsTest.EmbeddedPTransform",
        NameUtils.approximatePTransformName(transform.getBound().getClass()));
    assertEquals(
        "NameUtilsTest.SomeTransform",
        NameUtils.approximatePTransformName(AutoValue_NameUtilsTest_SomeTransform.class));
    assertEquals("TextIO.Write", NameUtils.approximatePTransformName(TextIO.Write.class));
  }