code: public static int compose(final int major, final int minor, final int patch)
      {
          if (major < 0 || major > 255)
          {
              throw new IllegalArgumentException("major must be 0-255: " + major);
          }
  
          if (minor < 0 || minor > 255)
          {
              throw new IllegalArgumentException("minor must be 0-255: " + minor);
          }
  
          if (patch < 0 || patch > 255)
          {
              throw new IllegalArgumentException("patch must be 0-255: " + patch);
          }
  
          if (major + minor + patch == 0)
          {
              throw new IllegalArgumentException("all parts cannot be zero");
          }
  
          return (major << 16) | (minor << 8) | patch;
      }
docs: Compose a 4-byte integer with major, minor, and patch version stored in the least significant 3 bytes.
  The sum of the components must be greater than zero.
  
  @param major version in the range 0-255.
  @param minor version in the range 0-255
  @param patch version in the range 0-255.
  @return the semantic version made from the three components.
  @throws IllegalArgumentException if the values are outside acceptable range.