private static Collection < Writer > getAllWriters ( final Collection < Writer > [ ] [ ] matrix ) { Collection < Writer > writers = Collections . newSetFromMap ( new IdentityHashMap < Writer , Boolean > ( ) ) ; for ( int i = 0 ; i < matrix . length ; ++ i ) { for ( int j = 0 ; j < matrix [ i ] . length ; ++ j ) { writers . addAll ( matrix [ i ] [ j ] ) ; } } return writers ; }
Collects all writer instances from a matrix of writers .