### Question:
MethodRemovalRule implements ComparingValidationRule { @Override public void methodRemoved(final ValidationContext ctx, final MethodDescriptor current) { if (!current.options().getDeprecated()) { ctx.report( ViolationType.WIRE_INCOMPATIBILITY_VIOLATION, "method removed" ); } } private  MethodRemovalRule(); static MethodRemovalRule create(); @Override void methodRemoved(final ValidationContext ctx, final MethodDescriptor current);  }### Answer:
@Test public void testMethodRemoved() throws Exception { final DescriptorSet current = DescriptorSetUtils.buildDescriptorSet( "a.proto", "syntax = 'proto3';\n" + "service Derp {\n" + " rpc GetDerp (HerpDerp) returns (HerpDerp);\n" + "}\n" + "message HerpDerp {}" ); final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet( "a.proto", "syntax = 'proto3';\n" + "service Derp {\n" + "}\n" + "message HerpDerp {}" ); final ImmutableList<ValidationViolation> violations = schemaValidator.validate(current, candidate); assertThat( violations, contains( validationViolation() .type(equalTo(ViolationType.WIRE_INCOMPATIBILITY_VIOLATION)) .description(equalTo("method removed")) ) ); }