BundleFinalizationHandlers { public static InMemoryFinalizer inMemoryFinalizer(InstructionRequestHandler fnApiControlClient) { return new InMemoryFinalizer(fnApiControlClient); }  static InMemoryFinalizer inMemoryFinalizer(InstructionRequestHandler fnApiControlClient);  }
@Test public void testInMemoryFinalizer() { InstructionRequestHandler mockHandler = mock(InstructionRequestHandler.class); InMemoryFinalizer finalizer = BundleFinalizationHandlers.inMemoryFinalizer(mockHandler); finalizer.finalizeAllOutstandingBundles(); verifyZeroInteractions(mockHandler); finalizer.requestsFinalization("A"); finalizer.requestsFinalization("B"); verifyZeroInteractions(mockHandler); finalizer.finalizeAllOutstandingBundles(); verify(mockHandler).handle(requestFor("A")); verify(mockHandler).handle(requestFor("B")); }