code: public static Version stringToVersion(String str) {
          if (str == null || str.isEmpty() || str.equals("0")) {
              return Version.emptyVersion;
          }
  
          if (str.equals("1") || str.equals("1.0") || str.equals("1.0.0"))
              return VERSION_1_0;
  
          return new Version(str);
      }
docs: Convert a string into a Version, reusing common Version
  objects if we can.
  
  @param str String to convert to a Version
  @return Version