@@ -0,0 +1,1120 @@
+package com.lithium.flow.util;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.util.ArrayList;%0A%0Aimport org.junit.Test;%0A%0Aimport com.google.common.collect.Lists;%0Aimport com.lithium.flow.util.Batcher.Batch;%0A%0A/**%0A * Created by bdharrington7 on 10/26/17.%0A */%0Apublic class BatcherTest %7B%0A%0A%09@Test%0A%09public void testCreateBatch() %7B%0A%09%09Batcher%3CInteger%3E batcher = new Batcher%3C%3E(3);%0A%09%09ArrayList%3CInteger%3E items = Lists.newArrayList(1, 2, 3);%0A%09%09for (Integer item : items) %7B%0A%09%09%09batcher.offer(item);%0A%09%09%7D%0A%0A%09%09try %7B%0A%09%09%09Batch%3CInteger%3E taken = batcher.take();%0A%09%09%09assertNotNull(taken);%0A%0A%09%09%09int idx = 0;%0A%09%09%09for (int i : taken) %7B%0A%09%09%09%09assertEquals(i, (int)items.get(idx++));%0A%09%09%09%7D%0A%0A%09%09%7D catch (InterruptedException iex) %7B%0A%09%09%09fail(%22Exception was thrown%22);%0A%09%09%7D%0A%09%7D%0A%0A%09@Test(expected = IllegalStateException.class)%0A%09public void testFinishThrows() %7B%0A%09%09Batcher%3CInteger%3E batcher = new Batcher%3C%3E(3);%0A%09%09ArrayList%3CInteger%3E items = Lists.newArrayList(1, 2, 3);%0A%09%09for (Integer item : items) %7B%0A%09%09%09batcher.offer(item);%0A%09%09%7D%0A%0A%0A%09%09batcher.finish();%0A%09%09batcher.finish();%0A%09%7D%0A%7D%0A

Add tests where there were none