@Test
public void testRemovingJarFile() throws IOException, ClassNotFoundException {

  ourLoggerInstance = new DefaultLogger("") {
    @Override
    public void error(@NonNls String message, @Nullable Throwable t, @NonNls @NotNull String... details) {
      fail("Logger shouldn't receive any error calls");
    }
  };
  File jarSource = new File(AndroidTestBase.getTestDataPath(), "rendering/renderClassLoader/lib.jar");
  File testJarFile = File.createTempFile("RenderClassLoader", ".jar");
  FileUtil.copy(jarSource, testJarFile);
  URL testJarFileUrl = testJarFile.toURI().toURL();
  RenderClassLoader loader = new RenderClassLoader(this.getClass().getClassLoader()) {
    @Override
    protected List<URL> getExternalJars() {
      return ImmutableList.of(testJarFileUrl);
    }
  };
  loader.loadClassFromNonProjectDependency("com.myjar.MyJarClass");
  assertTrue(testJarFile.delete());
  try {
    loader.loadClassFromNonProjectDependency("com.myjar.MyJarClass");
    fail("Class should be available anymore");
  } catch (ClassNotFoundException ignore) {
  }
}