List<Element> (Collection<? extends PsiMember> members, Collection<? extends PsiMember> selectedNotNullMembers, boolean useAccessors) { List<Element> elementList = new ArrayList<>(); for (PsiMember member : members) { AbstractElement element = null; if (member instanceof PsiField) { element = ElementFactory.newFieldElement((PsiField) member, useAccessors); } else if (member instanceof PsiMethod) { element = ElementFactory.newMethodElement((PsiMethod) member); } if (element != null) { if (selectedNotNullMembers.contains(member)) { element.setNotNull(true); } elementList.add(element); } } return elementList; }