@Test
  public void keysetEquality_twoKeysEquals_returnsTrue() throws Exception {
    SecretBytes bytes1 = SecretBytes.randomBytes(32);
    SecretBytes bytes2 = SecretBytes.randomBytes(32);

    KeysetHandle keysetHandle1 =
        KeysetHandle.newBuilder()
            .addEntry(
                KeysetHandle.importKey(XChaCha20Poly1305Key.create(bytes1))
                    .withFixedId(101)
                    .makePrimary())
            .addEntry(KeysetHandle.importKey(XChaCha20Poly1305Key.create(bytes2)).withFixedId(102))
            .build();
    KeysetHandle keysetHandle2 =
        KeysetHandle.newBuilder()
            .addEntry(
                KeysetHandle.importKey(XChaCha20Poly1305Key.create(bytes1))
                    .withFixedId(101)
                    .makePrimary())
            .addEntry(KeysetHandle.importKey(XChaCha20Poly1305Key.create(bytes2)).withFixedId(102))
            .build();

    assertTrue(keysetHandle1.equalsKeyset(keysetHandle2));
  }
Tests that key parsing via the serialization registry works as expected.

<p>NOTE: This adds a parser to the MutableSerializationRegistry, which no other test uses.
java_src/src/test/java/com/google/crypto/tink/KeysetHandleTest.java