CarpaccioManager implements MappingManager.MappingManagerCallback { public void addChildViews(View view) { if (mappingManager != null) { List<View> subViews = carpaccioSubViews.get(view); if (subViews == null) { subViews = new ArrayList<>(); carpaccioSubViews.put(view, subViews); } findCarpaccioControlledViews(view, subViews); } } CarpaccioManager(MappingManager mappingManager); void addView(View view); boolean isCarpaccioControlledView(View view); void registerController(Object controller); void registerControllers(Context context, String registerString); void executeActionsOnViews(); void executeActionsOnViews(List<View> views, Object mappedObject); void executeActionsOnView(View view); void executeActionsOnView(View view, Object mappedObject); void callActionOnView(CarpaccioAction action, View view); void mapObject(String name, Object object); Object getMappedObject(String name); void mapList(String mappedName, List list); void appendList(String mappedName, List list); List getMappedList(String name); Object registerAdapter(String mapName, Object adapter); T getAdapter(String mappedName); void addChildViews(View view); Object bindView(View view, String mapName, int position); Object bindView(View view, String mapName); void notifyAdapterDataSetChanded(Object adapter); void findCarpaccioControlledViews(View view); void findCarpaccioControlledViews(View view, List<View> listAddTo);  }
@Test public void testAddChildViews() throws Exception { ViewGroup viewGroup = mock(ViewGroup.class); doReturn(1).when(viewGroup).getChildCount(); View view = mock(View.class); doReturn(view).when(viewGroup).getChildAt(0); doReturn("setText(florent)").when(view).getTag(); carpaccioManager.addChildViews(viewGroup); assertTrue(carpaccioManager.carpaccioSubViews.get(viewGroup).contains(view)); }