### Question:
MessageBusServer { void initialize() throws Exception { LoggingService.logDebug(MODULE_NAME, "Starting initialization"); synchronized (messageBusSessionLock) { session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); connection.start(); } LoggingService.logDebug(MODULE_NAME, "Finished initialization"); }  boolean isConnected(); void setConnected(boolean connected); static final Object messageBusSessionLock; static final Object consumerLock; static final Object producerLock; }### Answer:
@Test public void testInitialize() { try { messageBusServer.startServer("localhost", 5672); messageBusServer.initialize(); Mockito.verify(connection, Mockito.atLeastOnce()).createSession(false, Session.CLIENT_ACKNOWLEDGE); Mockito.verify(connection, Mockito.atLeastOnce()).start(); PowerMockito.verifyStatic(LoggingService.class, atLeastOnce()); LoggingService.logDebug(MODULE_NAME, "Starting initialization"); PowerMockito.verifyStatic(LoggingService.class, atLeastOnce()); LoggingService.logDebug(MODULE_NAME, "Finished initialization"); } catch (Exception e) { fail("This should not happen"); } }