code: private AbstractSimon replaceUnknownSimon(AbstractSimon simon, Class<? extends AbstractSimon> simonClass) {
  		AbstractSimon newSimon = instantiateSimon(simon.getName(), simonClass);
  		newSimon.enabled = simon.enabled;
  
  		// fixes parent link and parent's children list
  		((AbstractSimon) simon.getParent()).replaceChild(simon, newSimon);
  
  		// fixes children list and all children's parent link
  		for (Simon child : simon.getChildren()) {
  			newSimon.addChild((AbstractSimon) child);
  			((AbstractSimon) child).setParent(newSimon);
  		}
  
  		allSimons.put(simon.getName(), newSimon);
  		return newSimon;
  	}
docs: called from synchronized method