public static String prevMinor(String base) {
        if (base == null || base.isEmpty()) {
            throw new IllegalArgumentException("Empty base version");
        }

        // strip suffix/qualifier as we dont support that
        base = base.replaceAll("[^\\d|^\\.]", "");
        if (!base.matches("[0-9]+(\\.[0-9]+)*")) {
            throw new IllegalArgumentException("Invalid version format");
        }

        Version ver = new Version(base);
        return ver.prevMinor();
    }
@Test
    public void testPrevMinor() throws Exception {
        assertEquals("3.2.0", prevMinor("3.3.0"));
        assertEquals("3.2.1", prevMinor("3.3.1"));
        assertEquals("3.0.0", prevMinor("3.0.0"));
        assertEquals("3.0.1", prevMinor("3.0.1"));
        assertEquals("3.3.1", prevMinor("3.4.1"));
        assertEquals("3.4.0", prevMinor("3.5.0"));
        assertEquals("3.5.0", prevMinor("3.6-SNAPSHOT"));

        assertEquals("3.4.0", prevMinor(prevMinor("3.6-SNAPSHOT")));
        assertEquals("3.4.0", prevMinor(prevMinor("3.6.0-SNAPSHOT")));
        assertEquals("3.4.1", prevMinor(prevMinor("3.6.1")));
        assertEquals("3.0.0", prevMinor(prevMinor("3.2.0")));
        assertEquals("3.0.1", prevMinor(prevMinor("3.1.1")));
    }