### Question:
ReversedBridgeMethodResolver { Method findBridgeMethod(Method original) { List<Method> candidates = Stream.of(original.getDeclaringClass().getDeclaredMethods()) .filter(Method::isBridge) .filter(candidate -> byName(original, candidate)) .filter(candidate -> byParameters(original, candidate)) .filter(candidate -> byReturnType(original, candidate)) .collect(toList()); if (candidates.isEmpty()) { return null; } if (candidates.size() > 1) { throw new IllegalArgumentException("More than one bridge candidate methods found: " + candidates); } return candidates.get(0); } private  ReversedBridgeMethodResolver(); static ReversedBridgeMethodResolver getInstance();  }### Answer:
@Test public void findBridgeMethod() throws NoSuchMethodException { Method method = Child.class.getMethod("method", String.class); Method bridgeMethod = reversedBridgeMethodResolver.findBridgeMethod(method); assertThat(bridgeMethod, notNullValue()); assertThat(bridgeMethod.getParameterTypes()[0], isA(Object.class)); assertThat(bridgeMethod.getReturnType(), isA(Object.class)); }
@Test public void findBridgeMethodExtends() throws NoSuchMethodException { Method method = ExtendsChild.class.getMethod("method", Exception.class); Method bridgeMethod = reversedBridgeMethodResolver.findBridgeMethod(method); assertThat(bridgeMethod, notNullValue()); assertTrue(Throwable.class.isAssignableFrom(bridgeMethod.getParameterTypes()[0])); assertTrue(Object.class.isAssignableFrom(bridgeMethod.getReturnType())); }
@Test public void notBridge() throws NoSuchMethodException { Method method = NotBridge.class.getMethod("method", RuntimeException.class); Method bridgeMethod = reversedBridgeMethodResolver.findBridgeMethod(method); assertThat(bridgeMethod, nullValue()); }