@VisibleForTesting
  public static void addUserAgentEnvironments(List<String> info) {
    info.add(String.format(OS_FORMAT, OSUtils.OS_NAME));
    if (EnvironmentUtils.isDocker()) {
      info.add(DOCKER_KEY);
    }
    if (EnvironmentUtils.isKubernetes()) {
      info.add(KUBERNETES_KEY);
    }
    if (EnvironmentUtils.isGoogleComputeEngine()) {
      info.add(GCE_KEY);
    } else {
      addEC2Info(info);
    }
  }
@Test
  public void userAgentEnvironmentStringEC2CFT() {
    String randomProductCode = "random123code";
    Mockito.when(EnvironmentUtils.isEC2()).thenReturn(true);
    Mockito.when(EnvironmentUtils.getEC2ProductCode()).thenReturn(randomProductCode);
    Mockito.when(EnvironmentUtils.isCFT(Mockito.anyString())).thenReturn(true);
    Mockito.when(EC2MetadataUtils.getUserData()).thenReturn("{ \"cft_configure\": {}}");

    List<String> info = new ArrayList<>();
    UpdateCheckUtils.addUserAgentEnvironments(info);
    Assert.assertEquals(4, info.size());
    Assert.assertEquals(String.format(UpdateCheckUtils.PRODUCT_CODE_FORMAT, randomProductCode),
        info.get(1));
    Assert.assertEquals(UpdateCheckUtils.CFT_KEY, info.get(2));
    Assert.assertEquals(UpdateCheckUtils.EC2_KEY, info.get(3));
  }