List<GraphEdge> (int nodeIndex, @NotNull EdgeFilter filter) { List<GraphEdge> result = new ArrayList<>(); for (GraphEdge upEdge : myUpEdges.get(nodeIndex)) { if (upEdge.getType().isNormalEdge() && filter.upNormal) result.add(upEdge); if (!upEdge.getType().isNormalEdge() && filter.special) result.add(upEdge); } for (GraphEdge downEdge : myDownEdges.get(nodeIndex)) { if (downEdge.getType().isNormalEdge() && filter.downNormal) result.add(downEdge); if (!downEdge.getType().isNormalEdge() && filter.special) result.add(downEdge); } return result; }