/** * Check for method overwriting. Returns true if every of the following condition holds: a) * the names of the methods are equal b) both methods take the same number of arguments c) * the arguemnt types match exactly d) the return type of the method represented by this * build plan is assignable to the return type of the given other method * * @param otherMethod * the method to check * @return true if the method described in this plan overrides the given method */ private boolean checkMethodOverriding(Method otherMethod) { if (!otherMethod.getReturnType().isAssignableFrom(this.returnType)) { return false; } Class<?>[] parameterTypes = otherMethod.getParameterTypes(); return isSignatureEqual(otherMethod.getName(), Arrays.asList(parameterTypes)); }