UIManagerModule extends ReactContextBaseJavaModule implements
    OnBatchCompleteListener, LifecycleEventListener { @ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); } UIManagerModule(
      ReactApplicationContext reactContext,
      List<ViewManager> viewManagerList,
      UIImplementation uiImplementation); @Override String getName(); @Override Map<String, Object> getConstants(); @Override void onHostResume(); @Override void onHostPause(); @Override void onHostDestroy(); @Override void onCatalystInstanceDestroy(); int addMeasuredRootView(final SizeMonitoringFrameLayout rootView); @ReactMethod void removeRootView(int rootViewTag); @ReactMethod void createView(int tag, String className, int rootViewTag, ReadableMap props); @ReactMethod void updateView(int tag, String className, ReadableMap props); @ReactMethod void manageChildren(
      int viewTag,
      @Nullable ReadableArray moveFrom,
      @Nullable ReadableArray moveTo,
      @Nullable ReadableArray addChildTags,
      @Nullable ReadableArray addAtIndices,
      @Nullable ReadableArray removeFrom); @ReactMethod void replaceExistingNonRootView(int oldTag, int newTag); @ReactMethod void removeSubviewsFromContainerWithID(int containerTag); @ReactMethod void measure(int reactTag, Callback callback); @ReactMethod void measureInWindow(int reactTag, Callback callback); @ReactMethod void measureLayout(
      int tag,
      int ancestorTag,
      Callback errorCallback,
      Callback successCallback); @ReactMethod void measureLayoutRelativeToParent(
      int tag,
      Callback errorCallback,
      Callback successCallback); @ReactMethod void findSubviewIn(
      final int reactTag,
      final ReadableArray point,
      final Callback callback); void registerAnimation(Animation animation); void addAnimation(int reactTag, int animationID, Callback onSuccess); void removeAnimation(int reactTag, int animationID); @ReactMethod void setJSResponder(int reactTag, boolean blockNativeResponder); @ReactMethod void clearJSResponder(); @ReactMethod void dispatchViewManagerCommand(int reactTag, int commandId, ReadableArray commandArgs); @ReactMethod void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success); @ReactMethod void setLayoutAnimationEnabledExperimental(boolean enabled); @ReactMethod void configureNextLayoutAnimation(
      ReadableMap config,
      Callback success,
      Callback error); @Override void onBatchComplete(); void setViewHierarchyUpdateDebugListener(
      @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener); EventDispatcher getEventDispatcher(); @ReactMethod void sendAccessibilityEvent(int tag, int eventType);  }
@Test public void testRemoveSubviewsFromContainerWithID() { UIManagerModule uiManager = getUIManagerModule(); ReactRootView rootView = new ReactRootView(RuntimeEnvironment.application.getApplicationContext()); int rootTag = uiManager.addMeasuredRootView(rootView); final int containerTag = rootTag + 1; final int containerSiblingTag = containerTag + 1; uiManager.createView( containerTag, ReactViewManager.REACT_CLASS, rootTag, JavaOnlyMap.of("collapsable", false)); uiManager.createView( containerSiblingTag, ReactViewManager.REACT_CLASS, rootTag, JavaOnlyMap.of("collapsable", false)); addChild(uiManager, rootTag, containerTag, 0); addChild(uiManager, rootTag, containerSiblingTag, 1); uiManager.createView( containerTag + 2, ReactTextViewManager.REACT_CLASS, rootTag, JavaOnlyMap.of("collapsable", false)); uiManager.createView( containerTag + 3, ReactTextViewManager.REACT_CLASS, rootTag, JavaOnlyMap.of("collapsable", false)); addChild(uiManager, containerTag, containerTag + 2, 0); addChild(uiManager, containerTag, containerTag + 3, 1); uiManager.onBatchComplete(); executePendingChoreographerCallbacks(); assertThat(rootView.getChildCount()).isEqualTo(2); assertThat(((ViewGroup)rootView.getChildAt(0)).getChildCount()).isEqualTo(2); uiManager.removeSubviewsFromContainerWithID(containerTag); uiManager.onBatchComplete(); executePendingChoreographerCallbacks(); assertThat(rootView.getChildCount()).isEqualTo(2); assertThat(((ViewGroup)rootView.getChildAt(0)).getChildCount()).isEqualTo(0); }