UnsupportedOverrideFactory implements PTransformOverrideFactory<InputT, OutputT, TransformT> { @Override public PTransformReplacement<InputT, OutputT> getReplacementTransform( AppliedPTransform<InputT, OutputT, TransformT> transform) { throw new UnsupportedOperationException(message); } private  UnsupportedOverrideFactory(String message); @SuppressWarnings("rawtypes") static UnsupportedOverrideFactory<InputT, OutputT, TransformT> withMessage(String message); @Override PTransformReplacement<InputT, OutputT> getReplacementTransform(
      AppliedPTransform<InputT, OutputT, TransformT> transform); @Override Map<PValue, ReplacementOutput> mapOutputs(
      Map<TupleTag<?>, PValue> outputs, OutputT newOutput);  }
@Test public void getReplacementTransformThrows() { thrown.expect(UnsupportedOperationException.class); thrown.expectMessage(message); factory.getReplacementTransform(null); }