Java examples for XML:JAXB
Ensure that the given object is not null, if it is fail the test
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { Object object1 = "java2s.com"; assertNotNull(object1);// ww w. ja v a 2 s . c om } /** * Ensure that the given object is not null, if it is fail the test * * @param object1 * The object to test */ public static void assertNotNull(Object object1) { if (object1 == null) { throw new RuntimeException("TEST FAILS: " + object1 + " must not be null"); } } }