StateTree { public final void registerNode(StateNode node) { assert node != null; assert node.getTree() == this; assert !node.isUnregistered() : "Can't re-register a node"; Double key = getKey(node); assert !idToNode.has(key) : "Node " + key + " is already registered"; idToNode.set(key, node); if (isUpdateInProgress()) { getRegistry().getInitialPropertiesHandler().nodeRegistered(node); } } 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(expected = AssertionError.class) public void testRegisterExistingThrows() { tree.registerNode(node); tree.registerNode(node); }
@Test(expected = AssertionError.class) public void testRegisterNullThrows() { tree.registerNode(null); }
@Test public void registerNode_updateIsNotInProgress_noPropertyHandlerCalls() { tree.registerNode(node); Mockito.verifyZeroInteractions(propertyHandler); }