Skip to content

Commit

Permalink
make the test more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed Dec 9, 2021
1 parent 9cb143a commit 22de64c
Showing 1 changed file with 4 additions and 7 deletions.
Expand Up @@ -31,12 +31,9 @@ public class MethodComparator {
MethodComparator::compareMethods, "compare method names, parameters and return types");

private static boolean compareMethods(Method actual, Method expected) {
if (!actual.getName().equals(expected.getName())
|| !Arrays.equals(actual.getParameterTypes(), expected.getParameterTypes())
|| actual.getModifiers() != expected.getModifiers()
|| !actual.getReturnType().equals(expected.getReturnType())) {
return false;
}
return true;
return actual.getName().equals(expected.getName())
&& Arrays.equals(actual.getParameterTypes(), expected.getParameterTypes())
&& actual.getModifiers() == expected.getModifiers()
&& actual.getReturnType().equals(expected.getReturnType());
}
}

0 comments on commit 22de64c

Please sign in to comment.