@Override
  public GetApplicationAttemptsResponse getApplicationAttempts(
      GetApplicationAttemptsRequest request) throws YarnException, IOException {
    GetApplicationAttemptsResponse response =
        GetApplicationAttemptsResponse
          .newInstance(new ArrayList<ApplicationAttemptReport>(history
            .getApplicationAttempts(request.getApplicationId()).values()));
    return response;
  }
@Test
  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();
    assertNotNull(attemptReports);
    assertEquals(appAttemptId, attemptReports.get(0)
        .getApplicationAttemptId());
    assertEquals(appAttemptId1, attemptReports.get(1)
        .getApplicationAttemptId());
  }