@Override
    @SuppressWarnings("checkstyle:booleanexpressioncomplexity")
    public int compareTo(MemberVersion otherVersion) {
        // pack major-minor-patch to 3 least significant bytes of integer, then compare the integers
        // even though major, minor & patch are not expected to be negative, masking makes sure we avoid sign extension
        int thisVersion = (major << 16 & 0xff0000) | ((minor << 8) & 0xff00) | (patch & 0xff);
        int thatVersion = (otherVersion.major << 16 & 0xff0000) | (otherVersion.minor << 8 & 0xff00)
                | (otherVersion.patch & 0xff);
        if (thisVersion > thatVersion) {
            return 1;
        } else {
            return thisVersion == thatVersion ? 0 : -1;
        }
    }
@Test
    public void testCompareTo() {
        assertTrue(VERSION_3_8.compareTo(VERSION_3_8) == 0);
        assertTrue(VERSION_3_8.compareTo(VERSION_3_8_1) < 0);
        assertTrue(VERSION_3_8.compareTo(VERSION_3_8_2) < 0);
        assertTrue(VERSION_3_8.compareTo(VERSION_3_9) < 0);

        assertTrue(VERSION_3_9.compareTo(VERSION_3_8) > 0);
        assertTrue(VERSION_3_9.compareTo(VERSION_3_8_1) > 0);
        assertTrue(VERSION_3_9.compareTo(VERSION_3_8_2) > 0);
    }