public static Map<String, Attachment> findNewAttachments(Map<String, ? extends Attachment> attachments) {
        Map<String, Attachment> newAttachments = new HashMap<String, Attachment>();
        for (Map.Entry<String, ? extends Attachment> a : attachments.entrySet()) {
            if (!(a instanceof SavedAttachment)) {
                newAttachments.put(a.getKey(), a.getValue());
            }
        }
        return newAttachments;
    }
public static Map < String , Attachment > findNewAttachments ( Map < String , ? extends Attachment > attachments ) { Map < String , Attachment > newAttachments = new HashMap < String , Attachment > ( ) ; for ( Map . Entry < String , ? extends Attachment > a : attachments . entrySet ( ) ) { if ( ! ( a instanceof SavedAttachment ) ) { newAttachments . put ( a . getKey ( ) , a . getValue ( ) ) ; } } return newAttachments ; }
Return a map of the new attachments in the map passed in.

@param attachments Attachments to search.
@return Map of attachments which need adding to the attachment store, or an empty map if none.