@Test
public void testApplications() throws IOException, YarnException {

  ApplicationId appId = null;
  appId = ApplicationId.newInstance(0, 1);
  writeApplicationStartData(appId);
  writeApplicationFinishData(appId);
  ApplicationId appId1 = ApplicationId.newInstance(0, 2);
  writeApplicationStartData(appId1);
  writeApplicationFinishData(appId1);
  GetApplicationsRequest request = GetApplicationsRequest.newInstance();
  GetApplicationsResponse response =
      historyServer.getClientService().getClientHandler()
        .getApplications(request);
  List<ApplicationReport> appReport = response.getApplicationList();
  Assert.assertNotNull(appReport);
  Assert.assertEquals(appId, appReport.get(0).getApplicationId());
  Assert.assertEquals(appId1, appReport.get(1).getApplicationId());
}