InvocationStrategy (final Object proxy, final Method method) { for (Pair<InvocationStrategy, Class<?>> pair : myAcceptsCache.get(method)) { if (Object.class.equals(pair.second) || pair.second.isInstance(proxy)) { return pair.first; } } throw new AssertionError("impossible"); }