@Override
    public int compareTo(COSObjectKey other)
    {
        return Long.compare(numberAndGeneration, other.numberAndGeneration);
    }
@Test
    void testSortingOrder()
    {
        // comparison is done by comparing the object numbers first
        // if they are equal the generation numbers are taken into account
        COSObjectKey key40 = new COSObjectKey(4, 0);
        COSObjectKey key41 = new COSObjectKey(4, 1);
        COSObjectKey key50 = new COSObjectKey(5, 0);

        assertEquals(0, key40.compareTo(key40));
        assertEquals(0, key41.compareTo(key41));
        assertEquals(-1, key40.compareTo(key41));
        assertEquals(-1, key40.compareTo(key50));
        assertEquals(-1, key41.compareTo(key50));
    }