@Test
  public void test_registerAllParametersParsers_checkDispatch() throws Exception {
    MutableSerializationRegistry registry = new MutableSerializationRegistry();
    registry.registerParametersParser(
        ParametersParser.create(
            MutableSerializationRegistryTest::parseAToParameters1, A_1, TestSerializationA.class));
    registry.registerParametersParser(
        ParametersParser.create(
            MutableSerializationRegistryTest::parseBToParameters1, B_1, TestSerializationB.class));
    registry.registerParametersParser(
        ParametersParser.create(
            MutableSerializationRegistryTest::parseAToParameters2, A_2, TestSerializationA.class));
    registry.registerParametersParser(
        ParametersParser.create(
            MutableSerializationRegistryTest::parseBToParameters2, B_2, TestSerializationB.class));
    assertThat(registry.hasParserForParameters(new TestSerializationA(A_1))).isTrue();
    assertThat(registry.parseParameters(new TestSerializationA(A_1)))
        .isInstanceOf(TestParameters1.class);
    assertThat(registry.parseParameters(new TestSerializationA(A_2)))
        .isInstanceOf(TestParameters2.class);
    assertThat(registry.parseParameters(new TestSerializationB(B_1)))
        .isInstanceOf(TestParameters1.class);
    assertThat(registry.parseParameters(new TestSerializationB(B_2)))
        .isInstanceOf(TestParameters2.class);
  }
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