code: private int[] parse(String version) {
          final Matcher m = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)-?(SNAPSHOT)?\\.?(\\d*)?").matcher(version);
          if (!m.matches()) {
              throw new IllegalArgumentException("Malformed version string: " + version);
          }
  
          return new int[] {Integer.parseInt(m.group(1)),   // major
                  Integer.parseInt(m.group(2)),             // minor
                  Integer.parseInt(m.group(3)),             // revision
                  m.group(4) == null ? 0                    // no SNAPSHOT suffix
                          : m.group(5).isEmpty() ? 0        // "SNAPSHOT"
                          : Integer.parseInt(m.group(5)),   // "SNAPSHOT.123"
          };
      }
docs: Parses the version.
  @param version the version to parse
  @return an int array consisting of major, minor, revision, and suffix