@Test
public void testNonExistentApp() throws Exception {

  YarnClient client = createCheckerWithMockedClient();
  ApplicationId id = ApplicationId.newInstance(1, 1);
  // test for null
  doReturn(null).when(client).getApplicationReport(id);
  assertFalse(checker.isApplicationActive(id));
  // test for ApplicationNotFoundException
  doThrow(new ApplicationNotFoundException("Throw!")).when(client)
      .getApplicationReport(id);
  assertFalse(checker.isApplicationActive(id));
}