@Test
  public void testNonSerializableObjectReturnedByCacheLoader() throws Exception {
    final VM cacheLoaderVM = VM.getVM(0);
    final VM fetchingVM = VM.getVM(1);

    final Properties properties = new Properties();
    properties.put(ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER,
        NotSerializableTestException.class.getName());

    cacheLoaderVM.invoke("create a region with a bad cache loader",
        () -> createRegionWithBadCacheLoader(properties));

    Assertions.assertThatThrownBy(() -> fetchingVM.invoke("fetch something from the cache",
        () -> fetchValueCausingCacheLoad(properties)))
        .hasCauseInstanceOf(InternalGemFireException.class)
        .hasRootCauseInstanceOf(NotSerializableException.class)
        .hasRootCauseMessage("java.lang.Object");
  }
Ensure that a cache loader throwing an exception that is not serializable is handled
correctly
geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/BadCacheLoaderDUnitTest.java