public String createULID(Message message) {
        checkTimestamp(message.getTimestamp().getMillis());
        try {
            return createULID(message.getTimestamp().getMillis(), message.getSequenceNr());
        } catch (Exception e) {
            LOG.error("Exception while creating ULID.", e);
            return ulid.nextULID(message.getTimestamp().getMillis());
        }
    }
@Test
    public void testUlidSorting() {
        final MessageULIDGenerator generator = new MessageULIDGenerator(new ULID());
        final long ts = Tools.nowUTC().getMillis();

        final long[] wrappedLongs = new long[]{0, 1, Integer.MAX_VALUE, 0xFFFF_FFFEL, 0xFFFF_FFFFL};

        final ArrayList<String> ulids = new ArrayList<>();
        for (long seq: wrappedLongs) {
            ulids.add(generator.createULID(ts, (int) seq));
        }
        final List<String> sortedUlids = ulids.stream().sorted().collect(Collectors.toList());

        assertThat(ulids).isEqualTo(sortedUlids);
    }