QualifiedName (int count) { int size = myComponents.size(); QualifiedName result = new QualifiedName(size); result.myComponents.addAll(myComponents); for (int i = 0; i < count && !result.myComponents.isEmpty(); i++) { result.myComponents.remove(result.myComponents.size()-1); } return result; }