public static void assertEquals(String message,Set<? extends Object> expected,Set<? extends Object> actual){
  Set<Object> onlyInExpected=new HashSet<Object>(expected);
  onlyInExpected.removeAll(actual);
  Set<Object> onlyInActual=new HashSet<Object>(actual);
  onlyInActual.removeAll(expected);
  if (onlyInExpected.size() != 0 || onlyInActual.size() != 0) {
    Set<Object> intersection=new HashSet<Object>(expected);
    intersection.retainAll(actual);
    failWithMessage(message,"Sets do not match.\nOnly in expected: " + onlyInExpected + "\nOnly in actual: "+ onlyInActual+ "\nIntersection: "+ intersection);
  }
}

public static void assertEquals ( String message , Set < ? extends Object > expected , Set < ? extends Object > actual ) { Set < Object > onlyInExpected = new HashSet < Object > ( expected ) ; onlyInExpected . removeAll ( actual ) ; Set < Object > onlyInActual = new HashSet < Object > ( actual ) ; onlyInActual . removeAll ( expected ) ; if ( onlyInExpected . size ( ) != 0 || onlyInActual . size ( ) != 0 ) { Set < Object > intersection = new HashSet < Object > ( expected ) ; intersection . retainAll ( actual ) ; failWithMessage ( message , "Sets do not match.\nOnly in expected: " + onlyInExpected + "\nOnly in actual: " + onlyInActual + "\nIntersection: " + intersection ) ; } }
asserts that two sets contain the same elements .
