### Question:
AnimationManagerStateController extends AbstractModuleStateController { @Override public boolean canActivateState(Node node) { try { return (Node)StateXML.newXPath().evaluate("/" + ModuleStateController.STATE_QNAME + "/:time/:animation", node, XPathConstants.NODE) != null; } catch (XPathExpressionException e) { LOGGER.error(e, e); return false; } } AnimationManagerStateController(AnimationManager animationManager, TimeManager timeManager); @Override void activateState(String id, String description, Collection<? extends String> tags, Node node); @Override void activateState(String id, String description, Collection<? extends String> tags, StateType state); @Override boolean canActivateState(Node node); @Override boolean canActivateState(StateType state); @Override boolean canSaveState(); @Override void deactivateState(String id, Node node); @Override void deactivateState(String id, StateType state); @Override boolean isSaveStateByDefault(); @Override void saveState(Node node); @Override void saveState(StateType state);  }### Answer:
@Test public void testCanActivateStateDefault() throws ParserConfigurationException, XPathExpressionException, AnimationPlanModificationException { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Node stateNode = doc.appendChild(StateXML.createElement(doc, ModuleStateController.STATE_NAME)); Node timeNode = stateNode.appendChild(StateXML.createElement(doc, TIME_TAG)); AnimationManager animationManager = EasyMock.createMock(AnimationManager.class); EasyMock.replay(animationManager); TimeManager timeManager = EasyMock.createMock(TimeManager.class); EasyMock.replay(timeManager); AnimationManagerStateController controller = new AnimationManagerStateController(animationManager, timeManager); Assert.assertFalse(controller.canActivateState(doc)); timeNode.appendChild(StateXML.createElement(doc, ANIMATION)); Assert.assertTrue(controller.canActivateState(doc)); }