Refactored getAst() and calcHashcode() in NewWarningDetectorTest.java.
Deleted there redundancy.