public static boolean isWaitCall(
    @NotNull PsiMethodCallExpression expression) {
    final PsiReferenceExpression methodExpression =
      expression.getMethodExpression();
    @NonNls final String methodName = methodExpression.getReferenceName();
    if (!HardcodedMethodConstants.WAIT.equals(methodName)) {
      return false;
    }
    final PsiMethod method = expression.resolveMethod();
    if (method == null) {
      return false;
    }
    final PsiParameterList parameterList = method.getParameterList();
    final int numParams = parameterList.getParametersCount();
    if (numParams > 2) {
      return false;
    }
    final PsiParameter[] parameters = parameterList.getParameters();
    if (numParams > 0) {
      final PsiType parameterType = parameters[0].getType();
      if (!parameterType.equals(PsiTypes.longType())) {
        return false;
      }
    }
    if (numParams > 1) {
      final PsiType parameterType = parameters[1].getType();
      if (!parameterType.equals(PsiTypes.intType())) {
        return false;
      }
    }
    return true;
  }
public static boolean isWaitCall(
    @NotNull PsiMethodCallExpression expression)