@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());
}