### Question:
EMailLogic { public boolean isConnectedToMailServer() { return this.mailSession.isConnected(); }  boolean hasNewMessages(boolean checkForImportant); int getNewMessageCount(boolean checkForImportant); String printMessages(int amount, boolean important); MessageDTO[] getMailsForREST(int amount); boolean connectToMailServer(EMailCredentials credentials); boolean isConnectedToMailServer(); void disconnectFromMailServer(); EMailCredentials getCredentials(); @PostConstruct void connectToMailServer();  }### Answer:
@Test protected void testIsConnectedToMailServer() { Assertions.assertFalse(this.emailLogic.isConnectedToMailServer()); when(this.mailSession.isConnected()).thenReturn(true); assertTrue(this.emailLogic.isConnectedToMailServer()); }