С Новым годом, уважаемые форумчане! Подскажите, как найти повторяющиеся исключения, если их имена и выполняемые действия разные? Не пропускает валидатор по 3-му пункту.
package com.javarush.task.task14.task1419;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.List;
/*
Нашествие исключений
*/
public class Solution {
public static List<Exception> exceptions = new ArrayList<Exception>();
public static void main(String[] args) {
initExceptions();
for (Exception exception : exceptions) {
System.out.println(exception);
}
}
private static void initExceptions() { //the first exception
exceptions.add(new Exception("ArithmeticException"));
exceptions.add(new Exception("ArrayIndexOutOfBoundsException"));
exceptions.add(new Exception("SecurityException"));
exceptions.add(new Exception("ClassCastException"));
exceptions.add(new Exception("ConcurrentModificationException"));
exceptions.add(new Exception("EmptyStackException"));
exceptions.add(new Exception("IllegalArgumentException"));
exceptions.add(new Exception("NoSuchElementException"));
exceptions.add(new Exception("MissingResourceException"));
exceptions.add(new Exception("NegativeArraySizeException"));
}
}