### Question:
BeanUtils { public static Collection<Method> getSetters(Object bean) { if (bean == null) { return null; } Collection<Method> result = new ArrayList<Method>(); for (Method method : bean.getClass().getMethods()) { if (method.getDeclaringClass() == Object.class) { continue; } if (method.getParameterTypes().length == 1) { if (method.getName().length() > 3 && method.getName().startsWith("set")) { result.add(method); } } } return result; }  static Map<String, Object> beanToMap(Object bean); static void mapToBean(Object bean, Map<String, Object> data, boolean ignoreNotExistingSetter); static Collection<Method> getGetters(Object bean); static Collection<Method> getSetters(Object bean); static String toAttributeName(Method m); static Method getSetter(Object bean, String attributeName);  }### Answer:
@Test public void testGetSetters() throws Exception { Bean1 b = new Bean1(); Collection<Method> setters = BeanUtils.getSetters(b); assertNotNull(setters); assertEquals(2, setters.size()); }