SONARJAVA-571 wait should not be called on Condition
Fix quality flaw
Refactor AbstractMethodDetection