/** * Copy constructor with a generic collection * @param externalCollection */ public IntegerUnion(Collection<Integer> externalCollection) { this(); if(externalCollection instanceof IntegerUnion) { copyExternalIntegerUnion((IntegerUnion)externalCollection); } else { for(Integer value : externalCollection) { internalAdd(value); } } }
/** * Copy constructor with a generic collection * @param externalCollection */ public IntegerUnion(Collection<Integer> externalCollection) { this(); if(externalCollection instanceof IntegerUnion) { copyExternalIntegerUnion((IntegerUnion)externalCollection); } else { for(Integer value : externalCollection) { internalAdd(value); } } }