public static long convertVersion(String version) throws IncompatibleVersionException {
        if (StringUtils.isBlank(version)) {
            throw new IllegalArgumentException("The version must not be blank.");
        }

        String[] parts = StringUtils.split(version, '.');
        int size = parts.length;
        if (size > MAX_VERSION_DOT + 1) {
            throw new IncompatibleVersionException("incompatible version format:" + version);
        }

        long result = 0L;
        int i = 1;
        size = MAX_VERSION_DOT + 1;
        for (String part : parts) {
            if (StringUtils.isNumeric(part)) {
                result += calculatePartValue(part, size, i);
            } else {
                String[] subParts = StringUtils.split(part, '-');
                if (StringUtils.isNumeric(subParts[0])) {
                    result += calculatePartValue(subParts[0], size, i);
                }
            }

            i++;
        }
        return result;
    }
@Test
    public void testConvertVersion() {
        // case: success
        Assertions.assertDoesNotThrow(() -> {
            long v = Version.convertVersion(Version.getCurrent());
            Assertions.assertTrue(v > 0);
        });
        Assertions.assertDoesNotThrow(() -> {
            long v = Version.convertVersion("1.7.0-SNAPSHOT");
            Assertions.assertEquals(1070000, v);
        });
        Assertions.assertDoesNotThrow(() -> {
            long v = Version.convertVersion("1.7.0");
            Assertions.assertEquals(1070000, v);
        });
        Assertions.assertDoesNotThrow(() -> {
            long v = Version.convertVersion("1.7.0-native-rc1-SNAPSHOT");
            Assertions.assertEquals(1070000, v);
        });
        Assertions.assertDoesNotThrow(() -> {
            long v = Version.convertVersion("1.7.0-native-rc1");
            Assertions.assertEquals(1070000, v);
        });

        // case: fail
        Assertions.assertThrows(IllegalArgumentException.class, () -> {
            Version.convertVersion(null);
        });
        Assertions.assertThrows(IllegalArgumentException.class, () -> {
            Version.convertVersion("     ");
        });
        Assertions.assertThrows(IncompatibleVersionException.class, () -> {
            Version.convertVersion("1.7.0.native.rc1-SNAPSHOT");
        });
        Assertions.assertThrows(IncompatibleVersionException.class, () -> {
            Version.convertVersion("1.7.0.native.rc1");
        });
    }