### Question:
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory);  }### Answer:
@Test public void build_shouldConstructACorrectlyConfiguredAsyncOpsLogger() throws Exception { AsyncOpsLogger<TestMessages> result = factory.build(infrastructure); assertEquals(Clock.systemUTC(), result.getClock()); assertSame(expectedDiagnosticContextSupplier, result.getDiagnosticContextSupplier()); assertSame(expectedDestination, result.getDestination()); assertSame(expectedErrorHandler, result.getErrorHandler()); assertNotNull(result.getTransferQueue()); verify(mockAsyncExecutor).execute(any(Runnable.class)); }
@Test public void build_shouldUseANewLinkedTransferQueueForEachConstructedOpsLogger() throws Exception { AsyncOpsLogger<TestMessages> firstResult = factory.build(infrastructure); AsyncOpsLogger<TestMessages> secondResult = factory.build(infrastructure); assertNotNull(firstResult.getTransferQueue()); assertNotNull(secondResult.getTransferQueue()); assertNotSame(firstResult, secondResult); }