ConcurrentMapBasedDoubleConsumerMemoizerTest.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:memoization.java 作者:
/**
*
*/
@Test
@SuppressWarnings(CompilerWarnings.UNUSED)
public void shouldRequireNonNullCache() {
    // given
    final ConcurrentMap<Double, Double> cache = null;
    final DoubleConsumer consumer = System.out::println;
    final DoubleFunction<Double> keyFunction = Double::valueOf;

    // when
    thrown.expect(NullPointerException.class);
    thrown.expectMessage("Provide an empty map instead of NULL.");

    // then
    new ConcurrentMapBasedDoubleConsumerMemoizer<>(cache, keyFunction, consumer);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号