### Question:
SQSItemQueue implements ItemQueue<T> { @Override public QueueResult<T> size() { SQSQueueResult sqsQueueResult = sizeRequestProcessor.processRequest(createRequestContext(new QueueRequest())); return new QueueResult<>(sqsQueueResult.isSuccessful(), null, sqsQueueResult.getMessage()); } 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 public void testSize() { final String EXPECTED_SIZE = "5"; SQSQueueResult sqsQueueResult = new SQSQueueResult().setSuccessful(true).setMessage(EXPECTED_SIZE); doReturn(sqsQueueResult).when(mockSizeRequestProcessor).processRequest(any()); QueueResult<T> queueResult = sqsItemQueue.size(); Assert.assertNotNull(queueResult); Assert.assertEquals(queueResult.getMessage(), EXPECTED_SIZE); }
@Test public void testSizeError() { SQSQueueResult sqsQueueResult = new SQSQueueResult().setSuccessful(false); doReturn(sqsQueueResult).when(mockSizeRequestProcessor).processRequest(any()); QueueResult<T> queueResult = sqsItemQueue.size(); Assert.assertNotNull(queueResult); Assert.assertFalse(queueResult.isSuccessful()); }