public static String format(String technicalVersion) {
    List<String> elements = Splitter.on(VERSION_SEQUENCE_SEPARATION).splitToList(technicalVersion);
    if (elements.size() != 4) {
      return technicalVersion;
    }

    // version has the form 6.3.1.4563
    StringBuilder builder = new StringBuilder();
    builder
      .append(elements.get(0))
      .append(VERSION_SEQUENCE_SEPARATION)
      .append(elements.get(1));
    if (!"0".equals(elements.get(2))) {
      builder.append(VERSION_SEQUENCE_SEPARATION)
        .append(elements.get(2));
    }

    builder.append(" (build ").append(elements.get(3)).append(")");

    return builder.toString();
  }
@Test
  public void format_technical_version() {
    assertThat(format("6.3")).isEqualTo("6.3");
    assertThat(format("6.3.2")).isEqualTo("6.3.2");
    assertThat(format("6.3.2.5498")).isEqualTo("6.3.2 (build 5498)");
    assertThat(format("6.3.0.5499")).isEqualTo("6.3 (build 5499)");
  }