String methodToCall = scope + "Method";
String expectMsg = "Class " + INVOKER_CLASS_NAME + " " + "can not access a member of class " + TARGET_CLASS_NAME + " "
+ "with modifiers \"" + (scope.equals("default") ? "" : scope) + "\"";
//First... we do set the Access flag, it should work!
Result r = runOnInstance(callerClazz, callerInstance, "callMethodWithAccess", methodToCall, true);
Assert.assertEquals(r.returnValue, methodToCall + " result");
//Then... we do not set the Access flag, it should fail!
try {
r = runOnInstance(callerClazz, callerInstance, "callMethodWithAccess", methodToCall, false);