NativeTransforms { public static boolean isNative(RunnerApi.PTransform pTransform) { Iterator<IsNativeTransform> matchers = ServiceLoader.load(IsNativeTransform.class, NativeTransforms.class.getClassLoader()) .iterator(); while (matchers.hasNext()) { if (matchers.next().test(pTransform)) { return true; } } return false; }  static boolean isNative(RunnerApi.PTransform pTransform);  }
@Test public void testMatch() { Assert.assertTrue( NativeTransforms.isNative( RunnerApi.PTransform.newBuilder() .setSpec(RunnerApi.FunctionSpec.newBuilder().setUrn("test").build()) .build())); }
@Test public void testNoMatch() { Assert.assertFalse(NativeTransforms.isNative(RunnerApi.PTransform.getDefaultInstance())); }