public staticMethod[]getDeclaredMethods(Classclazz) {
SetmethodSet= newHashSet<>();
Method[]declaredMethods;
for(; null !=clazz;clazz=clazz.getSuperclass()) {
declaredMethods=clazz.getDeclaredMethods();
for(Methodmethod:declaredMethods) {
methodSet.add(method);
}
}
returnmethodSet.toArray(newMethod[methodSet.size()]);
}