private void testScenario(String aConfiguration, boolean anExpectingAnException, Method aMethodToCall)
  throws Exception {
    openSession(aConfiguration);

    Element myElement = selectElement();

    String myMethodCallDescription;
    
    if (aMethodToCall != null) {
      Object[] myArguments = new Object[aMethodToCall.getParameterTypes().length];
      
      aMethodToCall.invoke(myElement, myArguments);
      
      myMethodCallDescription = aMethodToCall.toString();
    } else {
      myMethodCallDescription = "not called a method";
    }
    
    myElement = disableLazyLoaders(myElement);
    
    closeSession();
    
    try {
      Assert.assertEquals("parent", myElement.getElement().getValue());
      
        if (anExpectingAnException) {
          Assert.fail("Excpected an exception, since " + myMethodCallDescription + " should not trigger lazy loading");
        }
    } catch(Exception anException) {
        if (!anExpectingAnException) {
          Assert.fail("Did not expect an exception, because " + myMethodCallDescription + " should trigger lazy loading");
        }
    }
  }
Load an element with default configuration and call toString.
Expect that the toString triggers lazy loading which loads the nested Element
is available after closing the session.
src/test/java/org/apache/ibatis/submitted/automatic_lazy_loading/AutomaticLazyLoadingTest.java