@Test
  public void registerToInternalPrimitiveRegistry_works() throws Exception {
    PrimitiveRegistry.Builder initialBuilder = PrimitiveRegistry.builder();
    PrimitiveRegistry initialRegistry = initialBuilder.build();
    PrimitiveRegistry.Builder processedBuilder = PrimitiveRegistry.builder(initialRegistry);

    PublicKeySignWrapper.registerToInternalPrimitiveRegistry(processedBuilder);
    PrimitiveRegistry processedRegistry = processedBuilder.build();

    assertThrows(
        GeneralSecurityException.class,
        () -> initialRegistry.getInputPrimitiveClass(PublicKeySign.class));
    assertThat(processedRegistry.getInputPrimitiveClass(PublicKeySign.class))
        .isEqualTo(PublicKeySign.class);
  }
We test all variants for legacy reasons.
java_src/src/test/java/com/google/crypto/tink/signature/PublicKeySignWrapperTest.java