public static void assertEquals(String message,NominalMapping expected,NominalMapping actual,boolean ignoreOrder){
  if (expected == actual) {
    return;
  }
  Assert.assertTrue(expected == null && actual == null || expected != null && actual != null);
  if (expected == null || actual == null) {
    return;
  }
  Assert.assertEquals(message + " (nominal mapping size)",expected.size(),actual.size());
  List<String> expectedValues=expected.getValues();
  List<String> actualValues=actual.getValues();
  Set<String> expectedValuesSet=new HashSet<String>(expectedValues);
  Set<String> actualValuesSet=new HashSet<String>(actualValues);
  Assert.assertEquals(message + " (different nominal values)",expectedValuesSet,actualValuesSet);
  if (!ignoreOrder) {
    Iterator<String> expectedIt=expectedValues.iterator();
    while (expectedIt.hasNext()) {
      String expectedValue=expectedIt.next();
      Assert.assertEquals(message + " (index of nominal value '" + expectedValue+ "')",expected.mapString(expectedValue),actual.mapString(expectedValue));
    }
  }
}

public static void assertEquals ( String message , NominalMapping expected , NominalMapping actual , boolean ignoreOrder ) { if ( expected == actual ) { return ; } Assert . assertTrue ( expected == null && actual == null || expected != null && actual != null ) ; if ( expected == null || actual == null ) { return ; } Assert . assertEquals ( message + " (nominal mapping size)" , expected . size ( ) , actual . size ( ) ) ; List < String > expectedValues = expected . getValues ( ) ; List < String > actualValues = actual . getValues ( ) ; Set < String > expectedValuesSet = new HashSet < String > ( expectedValues ) ; Set < String > actualValuesSet = new HashSet < String > ( actualValues ) ; Assert . assertEquals ( message + " (different nominal values)" , expectedValuesSet , actualValuesSet ) ; if ( ! ignoreOrder ) { Iterator < String > expectedIt = expectedValues . iterator ( ) ; while ( expectedIt . hasNext ( ) ) { String expectedValue = expectedIt . next ( ) ; Assert . assertEquals ( message + " (index of nominal value '" + expectedValue + "')" , expected . mapString ( expectedValue ) , actual . mapString ( expectedValue ) ) ; } } }
tests two nominal mappings for its size and values .
