@Test
  public void propagatesNestedIllegalStateExceptionInObjectInputFilterException()
      throws InvocationTargetException, IllegalAccessException {
    GlobalSerialFilter globalSerialFilter =
        new ReflectiveFacadeGlobalSerialFilter(api, "the-pattern", singleton("class-name"));
    InvocationTargetException invocationTargetException =
        new InvocationTargetException(new IllegalStateException("testing"), "testing");
    doThrow(invocationTargetException).when(api).setSerialFilter(any());

    Throwable thrown = catchThrowable(() -> {
      globalSerialFilter.setFilter();
    });

    assertThat(thrown)
        .isInstanceOf(FilterAlreadyConfiguredException.class)
        .hasMessage(
            "Unable to configure a global serialization filter because filter has already been set non-null.")
        .hasCauseInstanceOf(InvocationTargetException.class)
        .hasRootCauseInstanceOf(IllegalStateException.class)
        .hasRootCauseMessage("testing");
  }
The ObjectInputFilter API throws IllegalStateException nested within InvocationTargetException
if a non-null filter already exists.
geode-serialization/src/test/java/org/apache/geode/internal/serialization/filter/ReflectiveFacadeGlobalSerialFilterTest.java