private static void testSameGroupKeys(String keysIdentifier, Key key1, Key key2) {
    assertWithMessage(keysIdentifier + " are not equal: ").that(key1.equalsKey(key2)).isTrue();
    assertWithMessage(keysIdentifier + " have different ID requirements: ")
        .that(key1.getIdRequirementOrNull())
        .isEqualTo(key2.getIdRequirementOrNull());
    assertWithMessage(keysIdentifier + " have different parameters: ")
        .that(key1.getParameters())
        .isEqualTo(key2.getParameters());
    assertWithMessage(keysIdentifier + " have parameters with different hashCode values: ")
        .that(key1.getParameters().hashCode())
        .isEqualTo(key2.getParameters().hashCode());
  }
Helps check correctness of implementations of "equalsKey".

<p>This is similar to the Guava class {@code EqualsTester}, but uses {@code equalsKey} instead of
{@code equals}, and tests additional properties which are useful for keys only.

<p>Usage example:

<pre>
new KeyTester()
    .addEqualityGroup("128 bit AES Gcm Key", fixed128bitAesGcmKey(), fixed128bitAesGcmKey())
    .addEqualityGroup("256 bit AES Gcm Key", fixed256bitAesGcmKey(), fixed256bitAesGcmKey())
    .doTests();
</pre>

<p>Compared to the Guava {@code EqualsTester}, the user has to specify a name for each group
because keys cannot have a useful {@code toString} method.

<p>This API is currently internal. If needed, we can consider adding it to the public API after
we have some experience with it.
java_src/src/main/java/com/google/crypto/tink/internal/KeyTester.java