@Test(expected = YarnRuntimeException.class)
public void testExceptionThrownWithNoRunningContainersToKill()
    throws Exception {

  ConcurrentHashMap<ContainerId, Container> containers =
      new ConcurrentHashMap<>();
  Container c1 = createContainer(1, true, 1L, false);
  containers.put(c1.getContainerId(), c1);
  Context context = mock(Context.class);
  when(context.getContainers()).thenReturn(containers);
  CGroupsHandler cGroupsHandler = mock(CGroupsHandler.class);
  when(cGroupsHandler.getCGroupParam(
      CGroupsHandler.CGroupController.MEMORY,
      "",
      CGROUP_PARAM_MEMORY_OOM_CONTROL))
      .thenReturn("under_oom 1").thenReturn("under_oom 0");
  DefaultOOMHandler handler = new DefaultOOMHandler(context, false) {
    @Override
    protected CGroupsHandler getCGroupsHandler() {
      return cGroupsHandler;
    }
  };
  handler.run();
}