### Question:
ReservedProcessor { void scan(XClass javaClass) { reservedNumbers = new TreeSet<>(); reservedNames = new TreeMap<>(); scanReserved(javaClass, new HashSet<>()); }    }### Answer:
@Test public void testDuplicateReservedNumber() { expectedException.expect(ProtoSchemaBuilderException.class); expectedException.expectMessage("Found duplicate @ProtoReserved number 1 in org.infinispan.protostream.annotations.impl.ReservedProcessorTest.DuplicateNumber"); XClass classToTest = new ReflectionClassFactory().fromClass(DuplicateNumber.class); new ReservedProcessor().scan(classToTest); }
@Test public void testDuplicateReservedName() { expectedException.expect(ProtoSchemaBuilderException.class); expectedException.expectMessage("Found duplicate @ProtoReserved name \"triceratops\" in org.infinispan.protostream.annotations.impl.ReservedProcessorTest.DuplicateName"); XClass classToTest = new ReflectionClassFactory().fromClass(DuplicateName.class); new ReservedProcessor().scan(classToTest); }