public static void sameContent(Iterator expected, Iterator actual) {
   final Collection4 allExpected = new Collection4();
   while (expected.hasNext()) {
     allExpected.add(expected.next());
   }
   while (actual.hasNext()) {
     final Object current = actual.next();
     final boolean removed = allExpected.remove(current);
     if (!removed) {
       unexpected(current);
     }
   }
   Assert.isTrue(allExpected.isEmpty(), allExpected.toString());
 }
Exemple #2
0
  private Constraint addClassConstraint(ReflectClass claxx) {
    if (isTheObjectClass(claxx)) {
      return null;
    }

    if (claxx.isInterface()) {
      return addInterfaceConstraint(claxx);
    }

    final Collection4 newConstraints = introduceClassConstrain(claxx);
    if (newConstraints.isEmpty()) {
      QConClass qcc = new QConClass(_trans, claxx);
      addConstraint(qcc);
      return qcc;
    }

    return toConstraint(newConstraints);
  }