### Question:
InjectableMethod implements HasDependencies, Module { public static <D, A extends Annotation> List<InjectableMethod<?>> forAnnotatedMethods(@Nullable TypeLiteral<D> targetType, @Nullable D target, Class<A> annotationType) { return forInheritedMethods(targetType, target, method -> method.getAnnotation(annotationType) != null); } private <D> InjectableMethod(@Nullable TypeLiteral<D> targetType, @Nullable D target, Method method, @Nullable T result); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object that); Method method(); Key<T> key(); Class<? extends Annotation> scope(); boolean hasReturnValue(); @Override Set<Dependency<?>> getDependencies(); @Override void configure(Binder binder); Module bindingModule(); T invoke(); Provider<T> asProvider(); ThrowingSupplier<T, Throwable> asSupplier(); ThrowingRunnable<Throwable> asRunnable(); static InjectableMethod<T> forMethod(TypeLiteral<D> targetType, @Nullable D target, Method method, T result); static InjectableMethod<?> forMethod(TypeLiteral<D> targetType, @Nullable D target, Method method); static InjectableMethod<?> forDeclaredMethod(Class<D> targetType, String name, Class<?>... params); static InjectableMethod<?> forDeclaredMethod(D target, String name, Class<?>... params); static InjectableMethod<?> forDeclaredMethod(@Nullable Class<D> targetType, @Nullable D target, String name, Class<?>... params); static InjectableMethod<?> forDeclaredMethod(@Nullable TypeLiteral<D> targetType, @Nullable D target, String name, Class<?>... params); static List<InjectableMethod<?>> forAnnotatedMethods(@Nullable TypeLiteral<D> targetType, @Nullable D target, Class<A> annotationType); static List<InjectableMethod<?>> forInheritedMethods(@Nullable TypeLiteral<D> targetType, @Nullable D target, Predicate<? super Method> filter); static List<InjectableMethod<?>> forDeclaredMethods(@Nullable TypeLiteral<D> targetType, @Nullable D target, Predicate<? super Method> filter);  }### Answer:
@Test public void scanForMethods() throws Exception { class Woot { @Yay String foo() { return "foo"; } String bar() { return "bar"; } } List<InjectableMethod<?>> methods = InjectableMethod.forAnnotatedMethods(TypeLiteral.get(Woot.class), new Woot(), Yay.class); Injector injector = Guice.createInjector(Lists.transform(methods, InjectableMethod::bindingModule)); assertEquals("foo", injector.getInstance(String.class)); }