Code example for ArrayBlockingQueue

Methods: poll

0
		messages.add(message);
	} 
 
	public void receivesAMessage(Matcher<? super String> messageMatcher)
			throws InterruptedException { 
		final Message message = messages.poll(5, TimeUnit.SECONDS);
		assertThat(message, is(notNullValue()));
		assertThat(message.getBody(), messageMatcher);
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java