MethodScan { static <H extends HandlerMethod<?, ?, ?, ?>> ImmutableSetMultimap<DispatchKey, H> findMethodsBy(Class<?> declaringClass, MethodSignature<H, ?> signature) { MethodScan<H> operation = new MethodScan<>(declaringClass, signature); ImmutableSetMultimap<DispatchKey, H> result = operation.perform(); return result; } private  MethodScan(Class<?> declaringClass, MethodSignature<H, ?> signature);   }
@Test @DisplayName("provide a map with filter-less keys") void noFiltersInKeys() { ImmutableSetMultimap<DispatchKey, SubscriberMethod> map = findMethodsBy(FilteredSubscription.class, new SubscriberSignature()); map.keySet() .forEach(key -> assertEquals(key.withoutFilter(), key)); }
@Test @DisplayName("allow multiple subscriptions to the same rejection with different causes") void multipleRejectionSubscriptions() { ImmutableSetMultimap<DispatchKey, SubscriberMethod> map = findMethodsBy(ARejectionSubscriber.class, new SubscriberSignature()); assertThat(map.keys()).hasSize(2); }