### Question:
FabricReconciler { public void manageChildren(ReactShadowNode previousRootShadowNode, ReactShadowNode newRootShadowNode) { SystraceMessage.beginSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricReconciler.manageChildren") .flush(); try { List<ReactShadowNode> prevList = previousRootShadowNode == null ? null : previousRootShadowNode.getChildrenList(); manageChildren(newRootShadowNode, prevList, newRootShadowNode.getChildrenList()); } finally{ Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); } } FabricReconciler(UIViewOperationQueue uiViewOperationQueue); void manageChildren(ReactShadowNode previousRootShadowNode, ReactShadowNode newRootShadowNode);  }### Answer:
@Test public void testSimpleHierarchy() { ReactShadowNode parent = createNode(0); ReactShadowNode child1 = createNode(1); ReactShadowNode child2 = createNode(2); addChildren(parent, child1, child2); ReactShadowNode parentCloned = createNode(0); ReactShadowNode child3 = createNode(3); addChildren(parentCloned, child3, child2); mFabricReconciler.manageChildren(parent, parentCloned); List<ManageChildrenOperation> expectedOperations = new ArrayList<>(); expectedOperations.add( new ManageChildrenOperation( 0, new int[] {0, 1}, new ViewAtIndex[] {new ViewAtIndex(3, 0), new ViewAtIndex(2, 1)}, new int[] {1})); assertThat(mMockUIViewOperationQueue.getOperations()).isEqualTo(expectedOperations); }
@Test public void testVirtualNodes() { ReactShadowNode parent = createNode(0); ReactShadowNode child1 = createVirtualNode(1); ReactShadowNode child2 = createVirtualNode(2); ReactShadowNode child3 = createVirtualNode(3); addChildren(parent, child1, child2, child3); ReactShadowNode parentCloned = createNode(0); ReactShadowNode child4 = createVirtualNode(4); addChildren(parentCloned, child1, child4, child3); mFabricReconciler.manageChildren(parent, parentCloned); List<ManageChildrenOperation> expectedOperations = new ArrayList<>(); assertThat(mMockUIViewOperationQueue.getOperations()).isEqualTo(expectedOperations); }