FacetInfo (@NotNull FacetInfo info) { final FacetInfo parent = getParent(info); final List<FacetInfo> children = getChildren(parent); int index = children.indexOf(info); if (index < children.size() - 1) { return children.get(index + 1); } if (index > 0) { return children.get(index - 1); } return parent; }