code: public int compareTo(Version version) {
          int mine = (1000 * major) + (100 * minor) + (revision * 10);
          int theirs = (1000 * version.major) + (100 * version.minor) + (version.revision * 10);
  
          if (mine == theirs && tag != null && version.tag != null) {
              return version.tag.compareTo(tag);
          } else if (mine == theirs && tag == null && version.tag != null) {
              return -1;
          } else if (mine == theirs && tag != null && version.tag == null) {
              return 1;
          } else {
              return mine - theirs;
          }
      }
docs: Compares versions.  Note that if the major, minor, and revision are all
  the same tags are compared with {@link java.lang.String#compareTo(String) String.compareTo()}
  
  @param version
  @return