implemented NestedMethods.java