compareType(beforeMethod.getReturnType(), afterMethod.getReturnType(), afterMethod);
compareParams(beforeMethod.getParameterList(), afterMethod.getParameterList());
compareThrows(beforeMethod.getThrowsList(), afterMethod.getThrowsList(), afterMethod);
if (shouldCompareCodeBlocks()) {
final PsiCodeBlock beforeMethodBody = beforeMethod.getBody();
final PsiCodeBlock afterMethodBody = afterMethod.getBody();
if (null != beforeMethodBody && null != afterMethodBody) {
boolean codeBlocksAreEqual = beforeMethodBody.textMatches(afterMethodBody);
if (!codeBlocksAreEqual) {
String text1 = beforeMethodBody.getText().replaceAll("\\s+", "");
String text2 = afterMethodBody.getText().replaceAll("\\s+", "");
assertEquals("Methods not equal, Method: (" + afterMethod.getName() + ") Class:" + afterClass.getName(), text2, text1);
}
} else {
if (null != afterMethodBody) {
fail("MethodCodeBlocks is null: Method: (" + beforeMethod.getName() + ") Class:" + beforeClass.getName());