/** * Adds an element to the list if it is not already present. * <p> * <i>(Violation)</i> The <code>List</code> interface requires that this * method returns <code>true</code> always. However this class may return * <code>false</code> because of the <code>Set</code> behaviour. * * @param object the object to add * @return true if object was added */ @Override public boolean add(final E object) { // gets initial size final int sizeBefore = size(); // adds element if unique add(size(), object); // compares sizes to detect if collection changed return sizeBefore != size(); }