Java tutorial
//package com.java2s; public class Main { public static void require(boolean requirement) { if (!requirement) throw new IllegalArgumentException(); } public static void require(boolean requirement, String message) { if (!requirement) { throw (message != null) ? new IllegalArgumentException(message) : new IllegalArgumentException(); } } }