AsyncBroker { public Map<K, NoticeableFuture<V>> getOpenBids() { return Collections.<K, NoticeableFuture<V>>unmodifiableMap( _defaultNoticeableFutures); }  Map<K, NoticeableFuture<V>> getOpenBids(); NoticeableFuture<V> post(K key); NoticeableFuture<V> post(K key, boolean[] newMarker); NoticeableFuture<V> take(K key); boolean takeWithException(K key, Throwable throwable); boolean takeWithResult(K key, V result);  }
@Test public void testGetOpenBids() { AsyncBroker<String, String> asyncBroker = new AsyncBroker<>(); Map<String, NoticeableFuture<String>> map = asyncBroker.getOpenBids(); Assert.assertTrue(map.toString(), map.isEmpty()); try { map.clear(); Assert.fail(); } catch (UnsupportedOperationException unsupportedOperationException) { } NoticeableFuture<String> noticeableFuture = asyncBroker.post(_KEY); Assert.assertEquals(map.toString(), 1, map.size()); Assert.assertSame(noticeableFuture, map.get(_KEY)); noticeableFuture.cancel(true); Assert.assertTrue(map.toString(), map.isEmpty()); }