### Question:
BeanUtils { public static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate) { return Arrays.stream(clazz.getMethods()) .filter(m -> !m.isSynthetic()) .filter(predicate); } private  BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Class<?> clazz, Predicate<Method> predicate); static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate); static Field getDeclaredField(Class<?> clazz, String name); static Field getField(Class<?> clazz, String name); @CheckForNull static Object getValueFromField(Object object, String name); @CheckForNull static Object getValueFromField(Object object, Field field); static String getPropertyName(Method method); static String getPropertyName(Type returnType, String methodName); static final String GET_PREFIX; static final String SET_PREFIX; static final String IS_PREFIX; }### Answer:
@Test public void testGetMethods_AllMatchingMethodsAreFound() { Stream<Method> declaredMethods = BeanUtils.getMethods(Foo.class, (m) -> m.getName().equals("baz")); assertThat(declaredMethods.count(), is(2L)); }