/** A simple assertion checking mechanism.
 *
 * @author Jim Grundy
 * @version $Revision: 1.8 $ */

public class Assert 
{
    /** Check an assertion.
     *
     * If the assertion holds execution continues, otherwise execution
     * halts and the message is printed followed by a stack trace.
     *
     * @param assertion The assertion to check.  
     * @param message The message to print on failure. */
    public static void check(boolean assertion, String message)
    {
	if (!assertion) {
	    System.out.println("ASSERTION VIOLATED: " + message);
	    Thread.currentThread().dumpStack();
	    System.exit(1);
	}
    }
}


