List <MethodDeclaration> expectedMethodList = new ArrayList<MethodDeclaration>();
ICompilationUnit [] iUnits = packageFragment.getCompilationUnits();
for(ICompilationUnit iUnit : iUnits){
CompilationUnit unit = Visitor.parse(iUnit);
Visitor visitor = new Visitor();
unit.accept(visitor);
List <TypeDeclaration> typeList = new ArrayList<TypeDeclaration>(visitor.getClasses());
for(TypeDeclaration typeDeclaration: typeList){
expectedMethodList.addAll(Arrays.asList(typeDeclaration.getMethods()));
}
}