public final void addObject ( Object object ) { if ( object instanceof Iterable ) { // Iterable for ( Object o : ( Iterable < ? > ) object ) { objects . add ( o ) ; } } else if ( object . getClass ( ) . isArray ( ) ) { // Array for ( Object o : ( Object [ ] ) object ) { objects . add ( o ) ; } } else { // Single object objects . add ( object ) ; } }
declared final since this is invoked from constructors