question: public int process ( Collection < ? extends Object > aExpected , Collection < ? extends Object > aActual ) { expectedCount += aExpected . size ( ) ; actualCount += aActual . size ( ) ; Set < Object > actual = new HashSet < > ( aActual ) ; for ( Object eUnit : aExpected ) { boolean found = actual . remove ( eUnit ) ; if ( found ) { hitCount ++ ; } } return hitCount ; }
target:  Assumes that neither expected nor actual units contain any duplicates.