Replace `getMethods()` with `getDeclaredMethods()`