Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
- Method[] methods = Collections.class.getDeclaredMethods();
- for (Method method : methods) {
- if (Modifier.isStatic(method.getModifiers())
- && Modifier.isPublic(method.getModifiers())
- && method.getParameterCount() == 0 && List.class.isAssignableFrom(method.getReturnType())) {
- List list = (List) method.invoke(null);
- try {
- list.get(0);
- } catch (IndexOutOfBoundsException e) {
- System.out.println(list.getClass().getCanonicalName());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement