Comparator<MyNode> () { return (o1, o2) -> { if (o1.getConfigurable() instanceof JsonSchemaConfigurable && o2.getConfigurable() instanceof JsonSchemaConfigurable) { return COMPARATOR.compare(getSchemaInfo(o1), getSchemaInfo(o2)); } return o1.getDisplayName().compareToIgnoreCase(o2.getDisplayName()); }; }