@Test
  public void testExcludeTCCL() throws Exception {
    System.out.println("\nStarting ClassPathLoaderTest#testExcludeTCCL");

    ClassPathLoader dcl = ClassPathLoader.createWithDefaults(true);

    String classToLoad = "com.nowhere.TestExcludeTCCL";

    assertThatThrownBy(() -> {
      dcl.forName(classToLoad);

    }).isInstanceOf(ClassNotFoundException.class);

    ClassLoader cl = Thread.currentThread().getContextClassLoader();

    try {
      Thread.currentThread().setContextClassLoader(new GeneratingClassLoader());

      assertThatThrownBy(() -> {
        dcl.forName(classToLoad);
      }).isInstanceOf(ClassNotFoundException.class);
    } finally {
      Thread.currentThread().setContextClassLoader(cl);
    }
  }
Verifies that setting <tt>excludeThreadContextClassLoader</tt> to true will indeed exclude the
TCCL.
geode-core/src/test/java/org/apache/geode/internal/classloader/ClassPathLoaderTest.java