int[] (int id) { IntSet result = new IntOpenHashSet(); Queue<Integer> queue = new ArrayDeque<>(); queue.add(id); while (!queue.isEmpty()) { int recordId = queue.poll(); if (result.add(recordId)) { ProgressManager.checkCanceled(); for (int childId : FSRecords.listIds(recordId)) { queue.add(childId); } } } return result.toIntArray(); }