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);
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE