public void doTests() {
    for (Map.Entry<String, List<Key>> group : equivalenceGroups.entrySet()) {
      for (int i = 0; i < group.getValue().size(); ++i) {
        testSingleKey("Key #" + i + " from group " + group.getKey(), group.getValue().get(i));
      }
    }

    for (Map.Entry<String, List<Key>> group1 : equivalenceGroups.entrySet()) {
      for (Map.Entry<String, List<Key>> group2 : equivalenceGroups.entrySet()) {
        for (int i1 = 0; i1 < group1.getValue().size(); ++i1) {
          for (int i2 = 0; i2 < group2.getValue().size(); ++i2) {
            String group1Name = group1.getKey();
            String group2Name = group2.getKey();
            Key key1 = group1.getValue().get(i1);
            Key key2 = group2.getValue().get(i2);
            if (group1Name.equals(group2Name)) {
              String keysIdentifier =
                  "Keys #" + i1 + " and #" + i2 + " from group '" + group1Name + "'";
              testSameGroupKeys(keysIdentifier, key1, key2);
            } else {
              String keysIdentifier1 = "Key #" + i1 + " from group '" + group1.getKey() + "'";
              String keysIdentifier2 = "Key #" + i2 + " from group '" + group2.getKey() + "'";
              testDifferentGroupKeys(keysIdentifier1, keysIdentifier2, key1, key2);
            }
          }
        }
      }
    }
  }
Runs tests on the given equality groups.

<p>This tests the following properties on the previously configured equality groups:

<ul>
  <li>For each individual key {@code k}, we check consistency of {@code getIdRequirementOrNull}
      and {@code k.getParameters().hasIdRequirement()}.
  <li>For each pair {@code k1, k2} of keys in the same group, we check that {@code
      k1.equalsKey(k2)}, that {@code k1.getParameters().equals(k2.getParameters())}, that
      {@code k1.getParameters().hashCode() == k2.getParameters().hashCode()}, and that {@code
      Object.equals(k1.getIdRequirementOrNull(), k2.getIdRequirementOrNull())}.
  <li>For each pair {@code k1, k2} of keys in different groups, we check that {@code
      k1.equalsKey(k2)} is false.
</ul>
java_src/src/main/java/com/google/crypto/tink/internal/KeyTester.java