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;
}

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 ; }
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 .
