### Question:
ShingleProducer implements Runnable { void addBufferToQueue(Iterable<Token<String>> buffer) throws InterruptedException { List<Token<String>> tokenList = new ArrayList<>(); for (Token<String> token : buffer) { tokenList.add(token); queue.put(new ArrayList<>(tokenList)); } } ShingleProducer(Analyzer analyzer, Reader reader, BlockingQueue<List<Token<String>>> queue);  ShingleProducer(Analyzer analyzer, Reader reader,
      BlockingQueue<List<Token<String>>> queue, int shingleCount); @Override void run(); final static List<Token<String>> END_TOKEN; }### Answer:
@SuppressWarnings("unchecked") @Test public void testAddBufferToQueue() throws InterruptedException { Token<String> a = mock(Token.class); Token<String> b = mock(Token.class); Token<String> c = mock(Token.class); producer.addBufferToQueue(newArrayList(a, b, c)); assertThat(queue, contains(newArrayList(a), newArrayList(a, b), (List<Token<String>>) newArrayList(a, b, c))); }