Members () { return new Members() { private final Collection<PsiMethod> methods = new ArrayList<>(); private final Collection<GrField> fields = new ArrayList<>(); private final Collection<PsiClass> classes = new ArrayList<>(); private final Collection<PsiClassType> implementsTypes = new ArrayList<>(); @NotNull @Override public Collection<PsiMethod> getMethods() { return methods; } @NotNull @Override public Collection<GrField> getFields() { return fields; } @NotNull @Override public Collection<PsiClass> getClasses() { return classes; } @NotNull @Override public Collection<PsiClassType> getImplementsTypes() { return implementsTypes; } @Override public void addFrom(@NotNull Members other) { methods.addAll(other.getMethods()); fields.addAll(other.getFields()); classes.addAll(other.getClasses()); implementsTypes.addAll(other.getImplementsTypes()); } }; }