int (Item item) { if (item == null) { // 1-rc < 1, 1-ga > 1 return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX); } return switch (item.getType()) { case INTEGER_ITEM -> -1; // 1.any < 1.1 ? case STRING_ITEM -> comparableQualifier(value).compareTo(comparableQualifier(((StringItem)item).value)); case LIST_ITEM -> -1; // 1.any < 1-1 default -> throw new RuntimeException("invalid item: " + item.getClass()); }; }