@Test
public void testTakeWithResult() throws Exception {

	AsyncBroker<String, String> asyncBroker = new AsyncBroker<>();
	Map<String, DefaultNoticeableFuture<String>> defaultNoticeableFutures =
		ReflectionTestUtil.getFieldValue(
			asyncBroker, "_defaultNoticeableFutures");
	Assert.assertTrue(
		defaultNoticeableFutures.toString(),
		defaultNoticeableFutures.isEmpty());
	Assert.assertFalse(asyncBroker.takeWithResult(_KEY, _VALUE));
	NoticeableFuture<String> noticeableFuture = asyncBroker.post(_KEY);
	Assert.assertEquals(
		defaultNoticeableFutures.toString(), 1,
		defaultNoticeableFutures.size());
	Assert.assertSame(noticeableFuture, defaultNoticeableFutures.get(_KEY));
	Assert.assertTrue(asyncBroker.takeWithResult(_KEY, _VALUE));
	Assert.assertEquals(_VALUE, noticeableFuture.get());
	Assert.assertTrue(
		defaultNoticeableFutures.toString(),
		defaultNoticeableFutures.isEmpty());
	Assert.assertFalse(asyncBroker.takeWithResult(_KEY, _VALUE));
}