* Events, <code>FALSE</code> otherwise.
*/
public static boolean isNewOrReadStateChange(Collection<? extends ModelEvent> events) {
for (ModelEvent event : events) {
if (event instanceof NewsEvent) {
NewsEvent newsEvent = (NewsEvent) event;
boolean oldStateNew = INews.State.NEW.equals(newsEvent.getOldNews() != null ? newsEvent.getOldNews().getState() : null);
boolean currentStateNew = INews.State.NEW.equals(newsEvent.getEntity().getState());
if (oldStateNew != currentStateNew)
return true;
boolean oldStateUnread = isUnread(newsEvent.getOldNews() != null ? newsEvent.getOldNews().getState() : null);
boolean newStateUnread = isUnread(newsEvent.getEntity().getState());
if (oldStateUnread != newStateUnread)
return true;
}
}