@Test public void testHasNewMessagesNoMails() throws MessagingException { when(this.inboxMock.search(ArgumentMatchers.any(FlagTerm.class))).thenReturn(new Message[0]); assertEquals(false, this.emailLogic.hasNewMessages(false)); assertEquals(false, this.emailLogic.hasNewMessages(true)); }
public boolean hasNewMessages(boolean checkForImportant) { if (checkForImportant) { return !getNewImportantMessages().isEmpty(); } return !getNewMessages().isEmpty(); }
EMailLogic { public boolean hasNewMessages(boolean checkForImportant) { if (checkForImportant) { return !getNewImportantMessages().isEmpty(); } return !getNewMessages().isEmpty(); } }
EMailLogic { public boolean hasNewMessages(boolean checkForImportant) { if (checkForImportant) { return !getNewImportantMessages().isEmpty(); } return !getNewMessages().isEmpty(); }  }
EMailLogic { public boolean hasNewMessages(boolean checkForImportant) { if (checkForImportant) { return !getNewImportantMessages().isEmpty(); } return !getNewMessages().isEmpty(); }  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(); }
EMailLogic { public boolean hasNewMessages(boolean checkForImportant) { if (checkForImportant) { return !getNewImportantMessages().isEmpty(); } return !getNewMessages().isEmpty(); }  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();  }