public long maximumWeight() { assertThat("Invalid usage of context", isWeighted(), is(not(nullValue()))); long maximum = weigher.unitsPerEntry() * maximumSize.max(); return (maximum < 0) ? Long.MAX_VALUE : maximum; }
public long maximumSize() { assertThat("Invalid usage of context", maximumSize, is(not(nullValue()))); return maximumSize.max(); }