public synchronized void unexportChildren() throws RemoteException {
    if (IN_PROCESS) return;
    final ArrayList<RemoteObject> childrenRefs = new ArrayList<>(myChildren.keySet());
    myChildren.clear();
    for (RemoteObject child : childrenRefs) {
      child.unreferenced();
    }
  }
public synchronized void unexportChildren()