private static Set<Method> methodsByName(Class<?> type, final String name) {
    return FluentIterable
            .from(Arrays.asList(type.getDeclaredMethods()))
            .append(Arrays.asList(type.getMethods()))
            .filter(new Predicate<Method>() {
              @Override
              public boolean apply(Method method) {
                return Modifier.isPublic(method.getModifiers()) && method.getName().equals(name);
              }
            })
            .toSet();
  }
Gets all (public) methods by name using reflection
mongo/test/org/immutables/mongo/fixture/flags/FlagsTest.java