NameUtils { public static String approximatePTransformName(Class<?> clazz) { checkArgument(PTransform.class.isAssignableFrom(clazz)); if (clazz.getSimpleName().startsWith("AutoValue_")) { return approximatePTransformName(clazz.getSuperclass()); } return approximateSimpleName(clazz, false) .replaceFirst("\\.Bound$", ""); }  static String approximateSimpleName(Object object); static String approximateSimpleName(Object object, String anonymousValue); static String approximatePTransformName(Class<?> clazz);  }
@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)); }