Set<Integer> (int node) { Set<Integer> magicSet; magicSet = new HashSet<>(MAGIC_SET_SIZE); PriorityQueue<Integer> magicQueue = new PriorityQueue<>(MAGIC_SET_SIZE); magicQueue.addAll(ContainerUtil.map(myLinearBekGraph.getAdjacentEdges(node, EdgeFilter.NORMAL_DOWN), GRAPH_EDGE_TO_DOWN_NODE)); while (!magicQueue.isEmpty()) { Integer i = magicQueue.poll(); if (i > node + MAGIC_SET_SIZE) break; magicSet.add(i); magicQueue.addAll(ContainerUtil.map(myLinearBekGraph.getAdjacentEdges(i, EdgeFilter.NORMAL_DOWN), GRAPH_EDGE_TO_DOWN_NODE)); } return magicSet; }