}
Collections.sort(newChildren, new CompareByName());
Collections.sort(subcircs, this);
for (Component comp : subcircs) {
SubcircuitFactory factory = (SubcircuitFactory) comp.getFactory();
CircuitState state = factory.getSubstate(circuitState, comp);
SimulationTreeCircuitNode toAdd = null;
for (TreeNode o : children) {
if (o instanceof SimulationTreeCircuitNode) {
SimulationTreeCircuitNode n = (SimulationTreeCircuitNode) o;
if (n.circuitState == state) { toAdd = n; break; }