@Test
  public void testSupportedClasses() throws Exception {
    assertThat(Class_testSupportedClasses2.wasInvoked).isFalse();
    assertThat(Class_testSupportedClasses2.toDataInvoked).isFalse();
    assertThat(Class_testSupportedClasses2.fromDataInvoked).isFalse();

    DataSerializer ds1 = DataSerializer.register(Class_testSupportedClasses1.class);
    int id = ds1.getId();

    DataSerializer ds2 = DataSerializer.register(Class_testSupportedClasses2.class);
    int id2 = ds2.getId();

    try {
      Object o = new NonDataSerializable(new Random());
      DataSerializer.writeObject(o, getDataOutput());
      assertThat(Class_testSupportedClasses2.wasInvoked).isTrue();
      assertThat(Class_testSupportedClasses2.toDataInvoked).isTrue();
      assertThat(Class_testSupportedClasses2.fromDataInvoked).isFalse();

      Object o2 = DataSerializer.readObject(getDataInput());
      assertThat(Class_testSupportedClasses2.fromDataInvoked).isTrue();
      assertThat(o).isEqualTo(o2);
    } finally {
      InternalDataSerializer.unregister(id);
      InternalDataSerializer.unregister(id2);
    }

    Class_testSupportedClasses2.wasInvoked = false;
    Class_testSupportedClasses2.toDataInvoked = false;
    Class_testSupportedClasses2.fromDataInvoked = false;
  }
Tests that only one serializer is invoked when a serializer specifies its supported classes.
Alos tests UDDS1.
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java