unit tests for nest based access control

This commit is contained in:
Ganesh Pagade
2018-12-23 12:05:51 +05:30
parent 6ede1b7440
commit e8b07fea1d
2 changed files with 74 additions and 0 deletions
@@ -0,0 +1,24 @@
package com.baeldung;
import java.lang.reflect.Method;
public class Outer {
public void outerPublic() {
}
private void outerPrivate() {
}
class Inner {
public void innerPublic() {
outerPrivate();
}
public void innerPublicReflection(Outer ob) throws Exception {
Method method = ob.getClass().getDeclaredMethod("outerPrivate");
method.invoke(ob);
}
}
}