### Question:
SQSItemQueue implements ItemQueue<T> { @Override public QueueResult<T> add(T item) { return add(Collections.singletonList(item)); } SQSItemQueue(AmazonSQS amazonSQS, String queueURL, Class clazz); @Override QueueResult<T> add(T item); @Override QueueResult<T> add(Collection<T> items); @Override QueueResult<T> peek(); @Override QueueResult<T> poll(); @Override QueueResult<T> poll(int maxPollCount); @Override QueueResult<T> size(); ObjectMapper getObjectMapper(); void setObjectMapper(ObjectMapper objectMapper); AddRequestProcessor getAddRequestProcessor(); void setAddRequestProcessor(AddRequestProcessor addRequestProcessor); PollRequestProcessor getPollRequestProcessor(); void setPollRequestProcessor(PollRequestProcessor pollRequestProcessor); SizeRequestProcessor getSizeRequestProcessor(); void setSizeRequestProcessor(SizeRequestProcessor sizeRequestProcessor);  }### Answer:
@Test(dataProvider = "itemsDataProvider") public void testAddItems(T[] items) { Collection<T> itemsToAdd = Arrays.asList(items); SQSQueueResult sqsQueueResult = new SQSQueueResult().setSuccessful(true); doReturn(sqsQueueResult).when(mockAddRequestProcessor).processRequest(any()); QueueResult<T> queueResult = sqsItemQueue.add(itemsToAdd); Assert.assertNotNull(queueResult); Assert.assertTrue(queueResult.isSuccessful()); }
@Test public void testAddItemError() { SQSQueueResult sqsQueueResult = new SQSQueueResult().setSuccessful(false); doReturn(sqsQueueResult).when(mockAddRequestProcessor).processRequest(any()); QueueResult<T> queueResult = sqsItemQueue.add(Collections.singletonList(getTestObject())); Assert.assertNotNull(queueResult); Assert.assertFalse(queueResult.isSuccessful()); }