@VisibleForTesting
  public static String getUserAgentString(String id, CommonUtils.ProcessType processType,
      List<String> additionalInfo) {
    List<String> info = new ArrayList<>();
    info.add(id);
    addUserAgentEnvironments(info);
    info.addAll(additionalInfo);
    info.add(String.format("processType:%s", processType.toString()));
    return String.format("Alluxio/%s (%s)", ProjectConstants.VERSION,
        Joiner.on(USER_AGENT_SEPARATOR + " ").skipNulls().join(info));
  }
@Test
  public void userAgent() {
    String userAgentString = UpdateCheckUtils.getUserAgentString("cluster1",
        CommonUtils.ProcessType.MASTER, new ArrayList<>());
    Pattern pattern = Pattern.compile(
        String.format("Alluxio\\/%s \\(cluster1(?:.+)[^;]\\)", ProjectConstants.VERSION));
    Matcher matcher = pattern.matcher(userAgentString);
    Assert.assertTrue(matcher.matches());
  }