Comparator<MyNode> () { return (node1, node2) -> { final NamedConfigurable c1 = node1.getConfigurable(); final NamedConfigurable c2 = node2.getConfigurable(); if (c1 instanceof FrameworkDetectionConfigurable && !(c2 instanceof FrameworkDetectionConfigurable)) return 1; if (!(c1 instanceof FrameworkDetectionConfigurable) && c2 instanceof FrameworkDetectionConfigurable) return -1; return StringUtil.naturalCompare(node1.getDisplayName(), node2.getDisplayName()); }; }