@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 userAgentEnvironmentStringDocker() {
    Mockito.when(EnvironmentUtils.isDocker()).thenReturn(true);
    Mockito.when(EC2MetadataUtils.getUserData())
        .thenThrow(new SdkClientException("Unable to contact EC2 metadata service."));
    List<String> info = new ArrayList<>();
    UpdateCheckUtils.addUserAgentEnvironments(info);
    Assert.assertEquals(2, info.size());
    Assert.assertEquals(String.format(UpdateCheckUtils.OS_FORMAT, OSUtils.OS_NAME),
        info.get(0));
    Assert.assertEquals(UpdateCheckUtils.DOCKER_KEY, info.get(1));
  }