### Question:
JsonRecordSupport { public static String toLexSortableString(long value) { return toLexSortableString(Long.toString(value)); } private  JsonRecordSupport(); static void jsonStreamToRecords(Set<String> indexes, String dbPath, InputStream is, Consumer<JsonRecord> consumer); static String convertToDBPath(String base); static String validateKey(String key); static void jsonStreamToRecords(Set<String> indexes, JsonParser jp, String path, Consumer<JsonRecord> consumer); static String toLexSortableString(long value); static String toLexSortableString(int value); @SuppressWarnings("PMD.NPathComplexity") static String toLexSortableString(final String value); static final Pattern INTEGER_PATTERN; static final Pattern INDEX_EXTRACTOR_PATTERN; static final char NULL_VALUE_PREFIX; static final char FALSE_VALUE_PREFIX; static final char TRUE_VALUE_PREFIX; static final char NUMBER_VALUE_PREFIX; static final char NEG_NUMBER_VALUE_PREFIX; static final char STRING_VALUE_PREFIX; static final char ARRAY_VALUE_PREFIX; }### Answer:
@Test @SuppressWarnings("unchecked") public void testSmallValues() { String last=null; for (int i = -1000; i < 1000; i++) { String next = toLexSortableString(i); if( last != null ) { assertThat((Comparable)last).isLessThan(next); } last = next; } }
@Test @SuppressWarnings("unchecked") public void testFloatsValues() { assertThat(toLexSortableString("1.01")).isEqualTo("[101-"); assertThat(toLexSortableString("-100.5")).isEqualTo("--68994["); String last=null; for (int i = 0; i < 9000; i++) { String value = rtrim(String.format("23.%04d",i),"0"); String next = toLexSortableString(value); if( last != null ) { assertThat((Comparable)last).isLessThan(next); } last = next; } }