@Override
  protected Statement methodBlock(FrameworkMethod method) {
    FrameworkMethod newMethod;
    try {
      // Need the class from the custom loader now, so lets load the class.
      loadClassesWithCustomClassLoader();
      // The method as parameter is from the original class and thus not found in our
      // class loaded by the custom name (reflection is class loader sensitive)
      // So find the same method but now in the class from the class Loader.
      Method methodFromNewlyLoadedClass =
          testClassFromClassLoader.getJavaClass().getMethod(method.getName());
      newMethod = new FrameworkMethod(methodFromNewlyLoadedClass);
    } catch (ClassNotFoundException | NoSuchMethodException | SecurityException e) {
      // Show any problem nicely as a JUnit Test failure.
      return new Fail(e);
    }

    // We can carry out the normal JUnit functionality with our newly discovered method now.
    return super.methodBlock(newMethod);
  }
Load classes (TestCase, @Before and @After with custom class loader.

@throws ClassNotFoundException the class not found exception
extensions/geode-modules-session/src/integrationTest/java/org/apache/geode/modules/session/junit/PerTestClassLoaderRunner.java