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

    final ClassPathLoader dcl = ClassPathLoader.createWithDefaults(false);
    final String classToLoad = "com.nowhere.TestForNameWithTCCL";

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

    }).isInstanceOf(ClassNotFoundException.class);

    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    try {
      // ensure that TCCL is only CL that can find this class
      Thread.currentThread().setContextClassLoader(new GeneratingClassLoader());
      Class<?> clazz = dcl.forName(classToLoad);
      assertThat(clazz).isNotNull();
      Object instance = clazz.newInstance();
      assertThat(instance).isNotNull();
      assertThat(instance.getClass().getName()).isEqualTo(classToLoad);
    } finally {
      Thread.currentThread().setContextClassLoader(cl);
    }

    assertThatThrownBy(() -> {
      dcl.forName(classToLoad);
    }).isInstanceOf(ClassNotFoundException.class);
  }
Verifies that TCCL finds the class when {@link Class#forName(String, boolean, ClassLoader)}
uses {@link ClassPathLoader}.
geode-core/src/test/java/org/apache/geode/internal/classloader/ClassPathLoaderTest.java