public final void parseVersion(String version) {
        versionParts = new ArrayList<>();
        if (version != null) {
            final Pattern rx = Pattern
                    .compile("(\\d+[a-z]{1,3}$|[a-z]{1,3}[_-]?\\d+|\\d+|(rc|release|snapshot|beta|alpha)$)",
                            Pattern.CASE_INSENSITIVE);
            final Matcher matcher = rx.matcher(version.toLowerCase());
            while (matcher.find()) {
                versionParts.add(matcher.group());
            }
            if (versionParts.isEmpty()) {
                versionParts.add(version);
            }
        }
    }
@Test
    public void testParseVersion() {
        String version = "1.2r1";
        DependencyVersion instance = new DependencyVersion();
        instance.parseVersion(version);
        List<String> parts = instance.getVersionParts();
        assertEquals(3, parts.size());
        assertEquals("1", parts.get(0));
        assertEquals("2", parts.get(1));
        assertEquals("r1", parts.get(2));

        instance.parseVersion("x6.0");
        parts = instance.getVersionParts();
        assertEquals(2, parts.size());
        assertEquals("x6", parts.get(0));
        assertEquals("0", parts.get(1));
        // TODO(code review): should this be here/do something?
        //assertEquals("0", parts.get(2));

    }