### Question:
BatchManager implements BatchController<E, T> { @Override public Handler getHandler() { return this.handler; } protected  BatchManager(Builder builder, final Context context); @Override void addToBatch(final Collection<E> dataCollection); @Override Handler getHandler(); @Override SerializationStrategy<E, T> getSerializationStrategy(); @Override void flush(final boolean forced); void initialize(BatchController<E, T> batchController, Context context,
                           OnBatchReadyListener<E, T> onBatchReadyListener, Handler handler);  }### Answer:
@Test public void testHandlerNotNull() { SerializationStrategy<Data, Batch<Data>> serializationStrategy = mock(SerializationStrategy.class); PersistenceStrategy<Data> persistenceStrategy = mock(PersistenceStrategy.class); OnBatchReadyListener<Data, Batch<Data>> onBatchReadyListener = mock(OnBatchReadyListener.class); Context context = RuntimeEnvironment.application; HandlerThread handlerThread = new HandlerThread("test"); handlerThread.start(); Looper looper = handlerThread.getLooper(); Handler handler = new Handler(looper); SizeBatchingStrategy sizeBatchingStrategy = new SizeBatchingStrategy(5, persistenceStrategy); BatchController batchController = new BatchManager.Builder() .setSerializationStrategy(serializationStrategy) .setBatchingStrategy(sizeBatchingStrategy) .setHandler(handler) .setOnBatchReadyListener(onBatchReadyListener) .build(context); Assert.assertNotNull(batchController.getHandler()); batchController = new BatchManager.Builder() .setSerializationStrategy(serializationStrategy) .setBatchingStrategy(sizeBatchingStrategy) .setHandler(null) .setOnBatchReadyListener(onBatchReadyListener) .build(context); Assert.assertNotNull(batchController.getHandler()); }