int (Item item) { if (item == null) { return BigInteger_ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 > 1 } return switch (item.getType()) { case INTEGER_ITEM -> value.compareTo(((IntegerItem)item).value); case STRING_ITEM -> 1; // 1.1 > 1-sp case LIST_ITEM -> 1; // 1.1 > 1-1 default -> throw new RuntimeException("invalid item: " + item.getClass()); }; }