@Test
  public void test_registerAllParametersSerializers_checkDispatch() throws Exception {
    MutableSerializationRegistry registry = new MutableSerializationRegistry();
    registry.registerParametersSerializer(
        ParametersSerializer.create(
            MutableSerializationRegistryTest::serializeParameters1ToA,
            TestParameters1.class,
            TestSerializationA.class));
    registry.registerParametersSerializer(
        ParametersSerializer.create(
            MutableSerializationRegistryTest::serializeParameters1ToB,
            TestParameters1.class,
            TestSerializationB.class));
    registry.registerParametersSerializer(
        ParametersSerializer.create(
            MutableSerializationRegistryTest::serializeParameters2ToA,
            TestParameters2.class,
            TestSerializationA.class));
    registry.registerParametersSerializer(
        ParametersSerializer.create(
            MutableSerializationRegistryTest::serializeParameters2ToB,
            TestParameters2.class,
            TestSerializationB.class));
    assertThat(registry.hasSerializerForParameters(new TestParameters1(), TestSerializationA.class))
        .isTrue();
    assertThat(
            registry
                .serializeParameters(new TestParameters1(), TestSerializationA.class)
                .getObjectIdentifier())
        .isEqualTo(A_1);
    assertThat(
            registry
                .serializeParameters(new TestParameters2(), TestSerializationA.class)
                .getObjectIdentifier())
        .isEqualTo(A_2);
    assertThat(
            registry
                .serializeParameters(new TestParameters1(), TestSerializationB.class)
                .getObjectIdentifier())
        .isEqualTo(B_1);
    assertThat(
            registry
                .serializeParameters(new TestParameters2(), TestSerializationB.class)
                .getObjectIdentifier())
        .isEqualTo(B_2);
  }
Tests for {@link MutableSerializationRegistry}.

<p>We repeat the main tests in SerializationRegistryTest. There really shouldn't be both classes,
but currently this is what we need, and the other is what we should have.
java_src/src/test/java/com/google/crypto/tink/internal/MutableSerializationRegistryTest.java