### Question:
ApiServiceClient extends AppAdminClient { @Override public int actionUpgradeInstances(String appName, List<String> compInstances) throws IOException, YarnException { int result; Container[] toUpgrade = new Container[compInstances.size()]; try { int idx = 0; for (String instanceName : compInstances) { Container container = new Container(); container.setComponentInstanceName(instanceName); container.setState(ContainerState.UPGRADING); toUpgrade[idx++] = container; } String buffer = ServiceApiUtil.CONTAINER_JSON_SERDE.toJson(toUpgrade); ClientResponse response = getApiClient(getInstancesPath(appName)) .put(ClientResponse.class, buffer); result = processResponse(response); } catch (Exception e) { LOG.error("Failed to upgrade component instance: ", e); result = EXIT_EXCEPTION_THROWN; } return result; } ApiServiceClient();  ApiServiceClient(Configuration c); String getServicePath(String appName); Builder getApiClient(); Builder getApiClient(String requestPath); Service loadAppJsonFromLocalFS(String fileName, String serviceName,
      Long lifetime, String queue); @Override int actionLaunch(String fileName, String appName, Long lifetime,
      String queue); @Override int actionStop(String appName); @Override int actionStart(String appName); @Override int actionSave(String fileName, String appName, Long lifetime,
      String queue); @Override int actionDestroy(String appName); @Override int actionFlex(String appName, Map<String, String> componentCounts); @Override int enableFastLaunch(String destinationFolder); @Override String getStatusString(String appIdOrName); @Override int actionUpgradeExpress(String appName, File path); @Override int initiateUpgrade(String appName,
      String fileName, boolean autoFinalize); @Override int actionUpgradeInstances(String appName, List<String> compInstances); @Override int actionUpgradeComponents(String appName, List<String> components); @Override int actionCleanUp(String appName, String userName); @Override String getInstances(String appName, List<String> components,
      String version, List<String> containerStates); @Override int actionCancelUpgrade(
      String appName); @Override int actionDecommissionInstances(String appName, List<String>
      componentInstances);  }### Answer:
@Test public void testInstancesUpgrade() { String appName = "example-app"; try { int result = asc.actionUpgradeInstances(appName, Lists.newArrayList( "comp-1", "comp-2")); assertEquals(EXIT_SUCCESS, result); } catch (IOException | YarnException e) { fail(); } }