ShowHideControlArea extends ContextAwareAction { @Override public boolean canHandle(ActionContext context) { if (context == null) throw new IllegalStateException("ActionContext is null."); housing = ((ActionContextImpl) context).getTargetHousing(); return housing != null; } ShowHideControlArea(); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled(); @Override void actionPerformed(ActionEvent event);  }
@Test (dependsOnMethods = { "testConstructor" }, expectedExceptions={IllegalStateException.class}) public void testNullContext() { controlArea.canHandle(null); }