@Test public void codeBlockSuccess() { Generator<Object> function = new CheckedGenerator<Object>() { @Override public Object safeValue() { return null; } }; MutableMap<String, Object> values = UnifiedMap.newMap(); MapIterate.getIfAbsentPut(values, "test", function); }
@Test(expected = RuntimeException.class) public void codeBlockRuntimeException() { Generator<Object> function = new CheckedGenerator<Object>() { @Override public Object safeValue() { throw new RuntimeException(); } }; MutableMap<String, Object> values = UnifiedMap.newMap(); MapIterate.getIfAbsentPut(values, "test", function); }