SmartAdapter { public static MultiAdaptersCreator items(@NonNull List<?> items) { return new MultiAdaptersCreator(items); } private  SmartAdapter(); static MultiAdaptersCreator items(@NonNull List<?> items); static MultiAdaptersCreator empty();  }
@Test public void test_item_operations_adapter() { MultiAdapter adapter = SmartAdapter.items(mockList).adapter(); MockModel model = new MockModel(); adapter.addItem(model); verify(mockList).add(model); List<MockModel> modelList = Arrays.asList(new MockModel(), new MockModel()); adapter.addItems(modelList); verify(mockList).addAll(modelList); adapter.delItem(model); verify(mockList).remove(model); adapter.clearItems(); verify(mockList).clear(); }
@Test public void test_item_operations_recycler_adapter() { RecyclerMultiAdapter adapter = SmartAdapter.items(mockList).recyclerAdapter(); MockModel model = new MockModel(); adapter.addItem(model); verify(mockList).add(model); List<MockModel> modelList = Arrays.asList(new MockModel(), new MockModel()); adapter.addItems(modelList); verify(mockList).addAll(modelList); adapter.delItem(model); verify(mockList).remove(model); adapter.clearItems(); verify(mockList).clear(); }