Quick actions

cmd+k|ctrl+k

Navigation

Languages

assert testing environment

Snippet info

Language

Java

Visibility

public

Author

orochi-100

Created

2020-05-13T15:19:01Z

Updated

2020-05-18T07:39:13Z

/**
 * Assertions have been enabled via (-ea-)flag in run command
 * 
 * @author orochi-100
 * @version 13 May 2020
 */
public class Main {
    private static boolean isTestingEnvironment;
    static {
        assert isTestingEnvironment = true;
    }

    public static void main(String[] args) {
        Verify.verify(!isTestingEnvironment, "if you want to run the program, remove the -ea flag in the run command");
        
        System.out.println("Hello World!");
    }

}
INFO