### Question:
BaseBatchingStrategy implements BatchingStrategy<E, T> { @Override public void onDataPushed(Collection<E> dataCollection) { persistenceStrategy.add(dataCollection); } BaseBatchingStrategy(PersistenceStrategy<E> persistenceStrategy); @Override boolean isInitialized(); @Override void onDataPushed(Collection<E> dataCollection); @Override abstract void flush(boolean forced); @Override void onInitialized(Context context,
                              OnBatchReadyListener<E, T> onBatchReadyListener, Handler handler); Context getContext(); OnBatchReadyListener<E, T> getOnReadyListener(); PersistenceStrategy<E> getPersistenceStrategy();  }### Answer:
@Test public void testOnDataPushed() { PersistenceStrategy<Data> persistenceStrategy = mock(PersistenceStrategy.class); BaseBatchingStrategy<Data, Batch<Data>> baseBatchingStrategy = new BaseBatchingStrategy<Data, Batch<Data>>(persistenceStrategy) { @Override public void flush(boolean forced) { } }; ArrayList<Data> arrayList = Utils.fakeCollection(4); baseBatchingStrategy.onDataPushed(arrayList); baseBatchingStrategy.flush(false); when(persistenceStrategy.getData()).thenReturn(arrayList); when(persistenceStrategy.getDataSize()).thenReturn(arrayList.size()); verify(persistenceStrategy, times(1)).add(arrayList); }