public MessagesWrapper print() throws MessagingException {
   logger.info("Found message(s) : " + messages.size());
   for (Message message : messages) {
     logger.info(">>>>>>");
     logger.info("Date    : " + message.getSentDate());
     logger.info("From    : " + (message.getFrom().length > 0 ? message.getFrom()[0] : null));
     logger.info("Subject : " + message.getSubject());
     logger.info("<<<<<<");
   }
   return this;
 }
 public MessagesWrapper markAsRead(List<Message> messagez)
     throws IOException, MessagingException {
   if (folder.isOpen() && folder.getMode() != Folder.READ_WRITE) {
     folder.close(true);
   }
   if (!folder.isOpen()) {
     folder.open(Folder.READ_WRITE);
   }
   for (Message message : messagez) {
     message.setFlag(Flags.Flag.SEEN, true);
   }
   logger.info("Marked email(s) as read : " + messagez.size());
   return this;
 }