### Question:
SameProcessor implements Predicate<ClientProcessor> { @Override public boolean test(ClientProcessor processor) { EventProcessorInfo i = processor.eventProcessorInfo(); EventProcessorIdentifier id = new EventProcessorIdentifier(i.getProcessorName(), i.getTokenStoreIdentifier()); return processor.belongsToContext(context) && id.equals(eventProcessorIdentifier); } SameProcessor(TrackingEventProcessor processor);  SameProcessor(String context, ClientProcessor clientProcessor);  SameProcessor(String context, EventProcessorIdentifier eventProcessorIdentifier); @Override boolean test(ClientProcessor processor);  }### Answer:
@Test public void testMatch() { EventProcessorIdentifier id = new EventProcessorIdentifier("processorName", "tokenStore"); SameProcessor testSubject = new SameProcessor("context", id); ClientProcessor clientProcessor = new FakeClientProcessor("not-important", false, "context", EventProcessorInfo.newBuilder() .setProcessorName( "processorName") .setTokenStoreIdentifier( "tokenStore") .build()); assertTrue(testSubject.test(clientProcessor)); }
@Test public void testNotMatch() { EventProcessorIdentifier id = new EventProcessorIdentifier("processorName", "tokenStore"); SameProcessor testSubject = new SameProcessor("context", id); ClientProcessor clientProcessor1 = new FakeClientProcessor("not-important", false, "context", EventProcessorInfo.newBuilder() .setProcessorName( "anotherName") .setTokenStoreIdentifier( "tokenStore") .build()); ClientProcessor clientProcessor2 = new FakeClientProcessor("not-important", false, "context", EventProcessorInfo.newBuilder() .setProcessorName( "processorName") .setTokenStoreIdentifier( "anotherTokenStore") .build()); ClientProcessor clientProcessor3 = new FakeClientProcessor("not-important", false, "context2", EventProcessorInfo.newBuilder() .setProcessorName( "processorName") .setTokenStoreIdentifier( "tokenStore") .build()); assertFalse(testSubject.test(clientProcessor1)); assertFalse(testSubject.test(clientProcessor2)); assertFalse(testSubject.test(clientProcessor3)); }