Set<Integer> (String visibility) { Set<Integer> visibleNodes = new HashSet<>(); if (visibility.length() == 0) return visibleNodes; for (String number : visibility.split("\\|")) { visibleNodes.add(Integer.decode(number)); } return visibleNodes; }