public final void containsNoDuplicates ( ) { List < Entry < ? > > duplicates = newArrayList ( ) ; for ( Multiset . Entry < ? > entry : LinkedHashMultiset . create ( actual ( ) ) . entrySet ( ) ) { if ( entry . getCount ( ) > 1 ) { duplicates . add ( entry ) ; } } if ( ! duplicates . isEmpty ( ) ) { failWithoutActual ( simpleFact ( "expected not to contain duplicates" ) , fact ( "but contained" , duplicates ) , fullContents ( ) ) ; } }
Checks that the subject does not contain duplicate elements .