List<DomStub> (XmlName xmlName) { final List<? extends Stub> stubs = getChildrenStubs(); if (stubs.isEmpty()) { return Collections.emptyList(); } final List<DomStub> result = new SmartList<>(); //noinspection ForLoopReplaceableByForEach for (int i = 0, size = stubs.size(); i < size; i++) { final Stub stub = stubs.get(i); if (stub instanceof DomStub && ((DomStub)stub).matches(xmlName)) { result.add((DomStub)stub); } } return result; }