@Test public void testMatchCachesNoEviction() throws Exception { ElementMatcher<Object> matcher = new CachingMatcher<Object>(this.matcher, map); assertThat(matcher.matches(target), is(true)); assertThat(matcher.matches(target), is(true)); verify(this.matcher).matches(target); verifyNoMoreInteractions(this.matcher); verifyZeroInteractions(target); }
public boolean matches(T target) { Boolean cached = map.get(target); if (cached == null) { cached = onCacheMiss(target); } return cached; }
CachingMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Boolean cached = map.get(target); if (cached == null) { cached = onCacheMiss(target); } return cached; } }
CachingMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Boolean cached = map.get(target); if (cached == null) { cached = onCacheMiss(target); } return cached; } CachingMatcher(ElementMatcher<? super T> matcher, ConcurrentMap<? super T, Boolean> map); }
CachingMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Boolean cached = map.get(target); if (cached == null) { cached = onCacheMiss(target); } return cached; } CachingMatcher(ElementMatcher<? super T> matcher, ConcurrentMap<? super T, Boolean> map); boolean matches(T target); @Override String toString(); }
CachingMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Boolean cached = map.get(target); if (cached == null) { cached = onCacheMiss(target); } return cached; } CachingMatcher(ElementMatcher<? super T> matcher, ConcurrentMap<? super T, Boolean> map); boolean matches(T target); @Override String toString();  }