### Question:
ResourceComputationStage extends AbstractBaseStage { @Override public void process(ClusterEvent event) throws Exception { _eventId = event.getEventId(); BaseControllerDataProvider cache = event.getAttribute(AttributeName.ControllerDataProvider.name()); if (cache == null) { throw new StageException("Missing attributes in event:" + event + ". Requires DataCache"); } Map<String, Resource> resourceMap = new LinkedHashMap<>(); Map<String, Resource> resourceToRebalance = new LinkedHashMap<>(); Map<String, IdealState> idealStates = cache.getIdealStates(); boolean isTaskCache = cache instanceof WorkflowControllerDataProvider; processIdealStates(cache, resourceMap, resourceToRebalance, idealStates, isTaskCache); if (isTaskCache) { WorkflowControllerDataProvider taskDataCache = event.getAttribute(AttributeName.ControllerDataProvider.name()); processWorkflowConfigs(taskDataCache, resourceMap, resourceToRebalance); processJobConfigs(taskDataCache, resourceMap, resourceToRebalance, idealStates); } processCurrentStates(cache, resourceMap, resourceToRebalance, idealStates, isTaskCache); event.addAttribute(AttributeName.RESOURCES.name(), resourceMap); event.addAttribute(AttributeName.RESOURCES_TO_REBALANCE.name(), resourceToRebalance); }  @Override void process(ClusterEvent event);  }### Answer:
@Test public void testNull() { ResourceComputationStage stage = new ResourceComputationStage(); StageContext context = new StageContext(); stage.init(context); stage.preProcess(); boolean exceptionCaught = false; try { stage.process(event); } catch (Exception e) { exceptionCaught = true; } AssertJUnit.assertTrue(exceptionCaught); stage.postProcess(); }