AceAutocompleteServlet extends SlingAllMethodsServlet { protected List<Method> getPublicMethodsOfClass(Class clazz) { return Arrays.stream(clazz.getDeclaredMethods()).filter(m -> (m.getModifiers() & Modifier.PUBLIC) != 0) .collect(Collectors.toList()); }    }
@Test public void test_getPublicMethodsOfClass_ofAecuBinding() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { List<Method> result = underTest.getPublicMethodsOfClass(AecuBinding.class); assertNotNull(result); assertEquals(2, result.size()); assertEquals("contentUpgradeBuilder", result.get(0).getName()); assertEquals("validateAccessRights", result.get(1).getName()); }