@Test
  public void testAddEntry_addTwice_throws() throws Exception {
    KeysetHandle.Builder builder = KeysetHandle.newBuilder();
    KeysetHandle.Builder.Entry entry =
        KeysetHandle.generateEntryFromParametersName("AES256_CMAC").makePrimary().withRandomId();
    builder.addEntry(entry);
    assertThrows(IllegalStateException.class, () -> builder.addEntry(entry));
  }
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