private void tryToSupport(final Class<?> c) {
    illegalClass = c;
    try {
      DataSerializer.register(IllegalDS.class);
      fail("expected IllegalStateException");
    } catch (IllegalArgumentException expected) {
      if (c.isArray()) {
        assertTrue(expected.getMessage(),
            expected.getMessage().contains("an array class which is not allowed"));
      } else {
        assertTrue(expected.getMessage(),
            expected.getMessage().contains("has built-in support for class " + c.getName()));
      }
    }
  }
Tests that <code>RegistrationListener</code>s are invoked at the proper times.
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java