@Test public void testGeneric() { ClientProcessor clientProcessor = new FakeClientProcessor("clientId", true, EventProcessorInfo.newBuilder().setMode("Subscribing") .build()); EventProcessor processor = processorMapping.apply("processorName", asList(clientProcessor, clientProcessor)); assertTrue(processor instanceof GenericProcessor); assertEquals("Subscribing", processor.mode()); }
@Override public EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors) { String mode = modeOf(clientProcessors); if ("Tracking".equals(mode)) { return new TrackingProcessor(name, mode, clientProcessors); } else { return new GenericProcessor(name, mode, clientProcessors); } }
EventProcessorMapping implements BiFunction<String, Collection<ClientProcessor>, EventProcessor> { @Override public EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors) { String mode = modeOf(clientProcessors); if ("Tracking".equals(mode)) { return new TrackingProcessor(name, mode, clientProcessors); } else { return new GenericProcessor(name, mode, clientProcessors); } } }
EventProcessorMapping implements BiFunction<String, Collection<ClientProcessor>, EventProcessor> { @Override public EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors) { String mode = modeOf(clientProcessors); if ("Tracking".equals(mode)) { return new TrackingProcessor(name, mode, clientProcessors); } else { return new GenericProcessor(name, mode, clientProcessors); } }  }
EventProcessorMapping implements BiFunction<String, Collection<ClientProcessor>, EventProcessor> { @Override public EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors) { String mode = modeOf(clientProcessors); if ("Tracking".equals(mode)) { return new TrackingProcessor(name, mode, clientProcessors); } else { return new GenericProcessor(name, mode, clientProcessors); } }  @Override EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors); }
EventProcessorMapping implements BiFunction<String, Collection<ClientProcessor>, EventProcessor> { @Override public EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors) { String mode = modeOf(clientProcessors); if ("Tracking".equals(mode)) { return new TrackingProcessor(name, mode, clientProcessors); } else { return new GenericProcessor(name, mode, clientProcessors); } }  @Override EventProcessor apply(String name, Collection<ClientProcessor> clientProcessors);  }