AbstractComponent parent = Mockito.mock(AbstractComponent.class);
JTree tree = Mockito.mock(JTree.class);
TreePath treePath = Mockito.mock(TreePath.class);
ActionContextImpl actionContext = Mockito.mock(ActionContextImpl.class);
NodeViewManifestation selectedNodeView = Mockito.mock(NodeViewManifestation.class);
NodeViewManifestation parentNodeView = Mockito.mock(NodeViewManifestation.class);
Mockito.when(actionContext.getTargetHousing()).thenReturn(housing);
Mockito.when(actionContext.getTargetComponent()).thenReturn(ac);
Mockito.when(housing.getDirectoryArea()).thenReturn(directoryArea);
Mockito.when(directoryArea.getSelectedManifestations()).thenReturn(Collections.<View>singleton(selectedNodeView));
Mockito.when(directoryArea.getSelectedDirectoryNode()).thenReturn(selectedNode);
Mockito.when(selectedNode.getParentTree()).thenReturn(tree);
Mockito.when(tree.getSelectionPaths()).thenReturn(Arrays.array(treePath));
Mockito.when(treePath.getLastPathComponent()).thenReturn(selectedNode);
Mockito.when(selectedNode.getParent()).thenReturn(parentNode);
Mockito.when(parentNode.getUserObject()).thenReturn(parentNodeView);
Mockito.when(parentNodeView.getManifestedComponent()).thenReturn(parent);
Assert.assertFalse(action.canHandle(actionContext));
}