public List < T > getOutside ( List < T > storage ) { if ( storage == null ) { storage = new ArrayList < T > ( ) ; } else { storage . clear ( ) ; } storage . addAll ( a ) ; // bins specifies elements in order of first in 'a' to last for ( int i = bins . length - 1 ; i >= 0 ; i -- ) { storage . remove ( bins [ i ] ) ; } return storage ; }
This returns all the items that are not currently inside the bucket