PerNodeTimelineCollectorsAuxService extends AuxiliaryService { public boolean removeApplication(ApplicationId appId) { return collectorManager.remove(appId); } PerNodeTimelineCollectorsAuxService(); @VisibleForTesting  PerNodeTimelineCollectorsAuxService(
      NodeTimelineCollectorManager collectorsManager); boolean addApplicationIfAbsent(ApplicationId appId, String user); boolean removeApplication(ApplicationId appId); @Override void initializeContainer(ContainerInitializationContext context); @Override void stopContainer(ContainerTerminationContext context); @Override void initializeApplication(ApplicationInitializationContext context); @Override void stopApplication(ApplicationTerminationContext context); @Override ByteBuffer getMetaData(); @VisibleForTesting static PerNodeTimelineCollectorsAuxService launchServer(String[] args, NodeTimelineCollectorManager collectorManager,
      Configuration conf); static void main(String[] args);  }
@Test public void testRemoveApplication() throws Exception { auxService = createCollectorAndAddApplication(); assertTrue(auxService.hasApplication(appAttemptId.getApplicationId())); ContainerId containerId = getAMContainerId(); ContainerTerminationContext context = mock(ContainerTerminationContext.class); when(context.getContainerId()).thenReturn(containerId); when(context.getContainerType()).thenReturn( ContainerType.APPLICATION_MASTER); auxService.stopContainer(context); assertFalse(auxService.hasApplication(appAttemptId.getApplicationId())); auxService.close(); }