run -> Edit configurations,Configuration -> VM options, 在文本框中输入"-ea"或者"-enableassertions", 点击OK即可。再次运行,发现assert成功抛出异常信息。