@Test
  public void throwsNullPointerExceptionGivenNull()
      throws ClassNotFoundException, NoSuchMethodException {
    ObjectInputFilterApi api = new ReflectiveObjectInputFilterApi(apiPackage);

    Throwable thrown = catchThrowable(() -> {
      api.setSerialFilter(null);
    });

    assertThat(thrown)
        .isInstanceOf(InvocationTargetException.class)
        .hasCauseInstanceOf(NullPointerException.class);
  }
This test calls the real setSerialFilter which can only be set once within a JVM, so it's in an
integration test which forks a new JVM for the test class.
geode-serialization/src/integrationTest/java/org/apache/geode/internal/serialization/filter/ReflectiveObjectInputFilterApiSetFilterNullIntegrationTest.java