code: protected boolean removeChild(final Widget child,
                                    final GVRSceneObject childRootSceneObject, boolean preventLayout) {
          final boolean removed = mChildren.remove(child);
  
          Log.d(Log.SUBSYSTEM.WIDGET, TAG, "removeChild [%s] %b", child, removed);
          if (removed) {
              Log.d(Log.SUBSYSTEM.WIDGET, TAG, "removeChild(): '%s' removed", child.getName());
              if (childRootSceneObject.getParent() != getSceneObject()) {
                  Log.e(Log.SUBSYSTEM.WIDGET, TAG,
                          "removeChild(): '%s' is not a child of '%s' GVRSceneObject!",
                          child.getName(), getName());
              }
              getSceneObject().removeChildObject(childRootSceneObject);
              child.doOnDetached();
  
              final List<OnHierarchyChangedListener> listeners;
              synchronized (mOnHierarchyChangedListeners) {
                  listeners = new ArrayList<>(mOnHierarchyChangedListeners);
              }
              for (OnHierarchyChangedListener listener : listeners) {
                  listener.onChildWidgetRemoved(this, child);
              }
  
              onTransformChanged();
              if (!preventLayout) {
                  invalidateAllLayouts();
                  requestLayout();
              }
          } else {
              Log.w(TAG, "removeChild(): '%s' is not a child of '%s'!",
                      child.getName(), getName());
          }
          return removed;
      }
docs: Remove a {@link Widget} as a child of this instance.
  <p>
  <b>NOTE:</b> if an alternative root scene object was used to
  {@linkplain #addChild(Widget, GVRSceneObject) add} the child
  {@code Widget}, the caller must pass the alternative root to this method.
  Otherwise there may be dangling scene objects. It is the responsibility
  of the caller to keep track of the relationship between the child
  {@code Widget} and the alternative root scene object.
  
  @param child
  The {@code Widget} to remove.
  @param childRootSceneObject The root {@link GVRSceneObject} of the child
  @param preventLayout
  The {@code Widget} whether to call layout().
  @return {@code True} if {@code child} was a child of this instance and
  was successfully removed; {@code false} if {@code child} is not a
  child of this instance.