When running a Java program from the command line, assertions can be enabled with the -enableassertions option for the java command. Running this program would then (and only then) fail with an AssertionError:
public class App {
public static void main(String[] args) throws Exception {
foo(2);
}
private static void foo(int x) {
assert x > 5;
System.out.println(x);
}
}
How can this be done when running a Java program in Visual Studio Code with the Java Extension Pack?