public static Version fromString(String versionString) {
    checkArgument(!Strings.isNullOrEmpty(versionString));
    Version version = builder().setVersionType(Type.NORMAL).setVersionString(versionString).build();
    if (!EPOCH_PATTERN.matcher(versionString).matches()) {
      versionString = "0:" + versionString;
    }

    boolean isValid =
        version.segments().stream()
            .flatMap(segment -> segment.tokens().stream())
            .anyMatch(
                token ->
                    (token.isNumeric() && token.getNumeric() != 0)
                        || (token.isText() && !token.getText().isEmpty()));
    if (!isValid) {
      throw new IllegalArgumentException(
          String.format(
              "Input version string %s is not valid, it should contain at least one non-empty"
                  + " field.",
              versionString));
    }
    return version;
  }
@Test
  public void create_whenNormalVersionAndValueIsNull_throwsException() {
    assertThrows(IllegalArgumentException.class, () -> Version.fromString(null));
  }