@SuppressWarnings({"MethodWithMultipleLoops"}) public boolean hasChanges() { if (commentsMap.isEmpty()) return false; for (List<Comment> commentList : commentsMap.values()) { for (Comment comment : commentList) { if (comment.isNew()) return true; } } return false; }