StateTree { public void setUpdateInProgress(boolean updateInProgress) { assert this.updateInProgress != updateInProgress : "Inconsistent state tree updating status, expected " + (updateInProgress ? "no " : "") + " updates in progress."; this.updateInProgress = updateInProgress; getRegistry().getInitialPropertiesHandler().flushPropertyUpdates(); } 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 setUpdateInProgress_flushPropertyUpdates() { tree.setUpdateInProgress(true); Mockito.verify(propertyHandler).flushPropertyUpdates(); tree.setUpdateInProgress(false); Mockito.verify(propertyHandler, Mockito.times(2)) .flushPropertyUpdates(); }