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

    ClassLoader cl = new BrokenClassLoader();

    String classToLoad = "java.lang.String";

    assertThatThrownBy(() -> {
      Class.forName(classToLoad, true, cl);
    }).isInstanceOf(BrokenError.class);

    String resourceToGet = "java/lang/String.class";
    assertThatThrownBy(() -> {
      cl.getResource(resourceToGet);
    }).isInstanceOf(BrokenError.class);

    assertThatThrownBy(() -> {
      cl.getResourceAsStream(resourceToGet);
    }).isInstanceOf(BrokenError.class);
  }
Verifies that the {@link BrokenClassLoader} is broken and always throws errors. This is a
control which ensures that tests depending on <tt>BrokenClassLoader</tt> are valid.
geode-core/src/test/java/org/apache/geode/internal/classloader/ClassPathLoaderTest.java