Custom and model based detection of deficiencies related to Java multithreading