question: private Collection < Insanity > checkValueMismatch ( MapOfSets < Integer , CacheEntry > valIdToItems , MapOfSets < ReaderField , Integer > readerFieldToValIds , Set < ReaderField > valMismatchKeys ) { final List < Insanity > insanity = new ArrayList < > ( valMismatchKeys . size ( ) * 3 ) ; if ( ! valMismatchKeys . isEmpty ( ) ) { final Map < ReaderField , Set < Integer > > rfMap = readerFieldToValIds . getMap ( ) ; final Map < Integer , Set < CacheEntry > > valMap = valIdToItems . getMap ( ) ; for ( final ReaderField rf : valMismatchKeys ) { final List < CacheEntry > badEntries = new ArrayList < > ( valMismatchKeys . size ( ) * 2 ) ; for ( final Integer value : rfMap . get ( rf ) ) { for ( final CacheEntry cacheEntry : valMap . get ( value ) ) { badEntries . add ( cacheEntry ) ; } } CacheEntry [ ] badness = new CacheEntry [ badEntries . size ( ) ] ; badness = badEntries . toArray ( badness ) ; insanity . add ( new Insanity ( InsanityType . VALUEMISMATCH , "Multiple distinct value objects for " + rf . toString ( ) , badness ) ) ; } } return insanity ; }
target:  Internal helper method used by check that iterates over  valMismatchKeys and generates a Collection of Insanity  instances accordingly.  The MapOfSets are used to populate  the Insanity objects. 