StateTree { public boolean isVisible(StateNode node) { if (!node.hasFeature(NodeFeatures.ELEMENT_DATA)) { return true; } NodeMap visibilityMap = node.getMap(NodeFeatures.ELEMENT_DATA); Boolean visibility = (Boolean) visibilityMap .getProperty(NodeProperties.VISIBLE).getValue(); return !Boolean.FALSE.equals(visibility); } StateTree(Registry registry); void setUpdateInProgress(boolean updateInProgress); boolean isUpdateInProgress(); final void registerNode(StateNode node); void unregisterNode(StateNode node); void prepareForResync(); StateNode getNode(int id); StateNode getRootNode(); void sendEventToServer(StateNode node, String eventType,
            JsonObject eventData); void sendNodePropertySyncToServer(MapProperty property); void sendTemplateEventToServer(StateNode node, String methodName,
            JsArray<?> argsArray, int promiseId); void sendExistingElementAttachToServer(StateNode parent,
            int requestedId, int assignedId, String tagName, int index); void sendExistingElementWithIdAttachToServer(StateNode parent,
            int requestedId, int assignedId, String id); Registry getRegistry(); boolean isVisible(StateNode node); boolean isActive(StateNode node);  }
@Test public void isVisible_nodeHasNoFeature_nodeIsVisible() { Assert.assertTrue(tree.isVisible(node)); }
@Test public void isVisible_nodeHasFeatureAndVisibleValue_nodeIsVisible() { node.getMap(NodeFeatures.ELEMENT_DATA) .getProperty(NodeProperties.VISIBLE).setValue(true); Assert.assertTrue(tree.isVisible(node)); }
@Test public void isVisible_nodeHasFeatureAndNoValue_nodeIsVisible() { node.getMap(NodeFeatures.ELEMENT_DATA); Assert.assertTrue(tree.isVisible(node)); }
@Test public void isVisible_nodeHasFeatureAndNotVisibleValue_nodeIsNotVisible() { node.getMap(NodeFeatures.ELEMENT_DATA) .getProperty(NodeProperties.VISIBLE).setValue(false); Assert.assertFalse(tree.isVisible(node)); }