int (RefClass aClass) { if (!aClass.isAnonymous()) { int count = 0; for (RefMethod refConstructor : aClass.getConstructors()) { count += refConstructor.getInReferences().size(); } for (RefClass subClass : aClass.getSubClasses()) { count += getInstantiationsCount(subClass); count -= subClass.getConstructors().size(); } return count; } return 1; }