Code example for ArrayBlockingQueue

Methods: poll

0
        messages.add(message);
    } 
 
    public void receivesAMessage(Matcher<? super String> messageMatcher)
            throws InterruptedException { 
        final Message message = messages.poll(10, TimeUnit.SECONDS);
        assertThat("Message", message, is(notNullValue()));
        assertThat(message.getBody(), messageMatcher);
 
    } 
}