ApplicationHistoryClientService extends AbstractService implements
    ApplicationHistoryProtocol { @Override public GetApplicationAttemptsResponse getApplicationAttempts( GetApplicationAttemptsRequest request) throws YarnException, IOException { GetApplicationAttemptsResponse response = GetApplicationAttemptsResponse .newInstance(new ArrayList<ApplicationAttemptReport>(history .getApplicationAttempts(request.getApplicationId()).values())); return response; } ApplicationHistoryClientService(ApplicationHistoryManager history); @Private InetSocketAddress getBindAddress(); @Override CancelDelegationTokenResponse cancelDelegationToken(
      CancelDelegationTokenRequest request); @Override GetApplicationAttemptReportResponse getApplicationAttemptReport(
      GetApplicationAttemptReportRequest request); @Override GetApplicationAttemptsResponse getApplicationAttempts(
      GetApplicationAttemptsRequest request); @Override GetApplicationReportResponse getApplicationReport(
      GetApplicationReportRequest request); @Override GetApplicationsResponse getApplications(GetApplicationsRequest request); @Override GetContainerReportResponse getContainerReport(
      GetContainerReportRequest request); @Override GetContainersResponse getContainers(GetContainersRequest request); @Override GetDelegationTokenResponse getDelegationToken(
      GetDelegationTokenRequest request); @Override RenewDelegationTokenResponse renewDelegationToken(
      RenewDelegationTokenRequest request);  }
@Test public void testApplicationAttempts() throws IOException, YarnException { ApplicationId appId = ApplicationId.newInstance(0, 1); ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); ApplicationAttemptId appAttemptId1 = ApplicationAttemptId.newInstance(appId, 2); GetApplicationAttemptsRequest request = GetApplicationAttemptsRequest.newInstance(appId); GetApplicationAttemptsResponse response = clientService.getApplicationAttempts(request); List<ApplicationAttemptReport> attemptReports = response.getApplicationAttemptList(); Assert.assertNotNull(attemptReports); Assert.assertEquals(appAttemptId, attemptReports.get(0) .getApplicationAttemptId()); Assert.assertEquals(appAttemptId1, attemptReports.get(1) .getApplicationAttemptId()); }