@Test
  public void testBuilder_deletedPrimary_throws() throws Exception {
    KeysetHandle.Builder builder =
        KeysetHandle.newBuilder()
            .addEntry(
                KeysetHandle.generateEntryFromParametersName("AES256_CMAC")
                    .withRandomId()
                    .makePrimary())
            .addEntry(KeysetHandle.generateEntryFromParametersName("AES256_CMAC").withRandomId())
            .deleteAt(0);
    assertThrows(GeneralSecurityException.class, builder::build);
  }
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