ServiceViewItem (Deque<ServiceViewItem> path, List<? extends ServiceViewItem> modelItems) { ServiceViewItem node = path.removeFirst(); for (ServiceViewItem root : modelItems) { if (root.equals(node)) { if (path.isEmpty()) { return root; } else { return findItem(path, root.getChildren()); } } } return null; }