public class ListUtil {
private static final Logger LOGGER = LoggerFactory.createLogger();
public static void notifyListDataListeners(Object source, Set<ListDataListener> listDataListeners, int fromIndex, int toIndex, int eventType) {
try {
ListDataEvent event = new ListDataEvent(source, eventType, fromIndex, toIndex);
for (ListDataListener listener : listDataListeners) {
switch (eventType) {
case ListDataEvent.INTERVAL_ADDED: listener.intervalAdded(event); break;
case ListDataEvent.INTERVAL_REMOVED: listener.intervalRemoved(event); break;
case ListDataEvent.CONTENTS_CHANGED: listener.contentsChanged(event); break;