We implement our mail receiver client (pop3) using Java mail API. We use the following code part when fetching and determining the new unread mails:
public st