/** * Adds an object to the collection, throwing UnsupportedOperationException * unless a SetMutator strategy is specified. * * @param obj the object to add * @return {@code true} if the collection was modified * @throws UnsupportedOperationException if SetMutator hasn't been set or add is unsupported * @throws ClassCastException if the object cannot be added due to its type * @throws NullPointerException if the object cannot be added because its null * @throws IllegalArgumentException if the object cannot be added */ @Override public boolean add(final E obj) { if (mutator == null) { throw new UnsupportedOperationException( "add() is not supported on CompositeSet without a SetMutator strategy"); } return mutator.add(this, all, obj); }