VelocityUtil { public static Object getObject(Object value, Object defaultValue) { if (value == null) { value = defaultValue; } return value; } private  VelocityUtil(); @SuppressWarnings("unchecked") static Map<String, Object> getParameters(InternalContextAdapter context,
            Node node); static Object getObject(Object value, Object defaultValue);  }
@Test public void testGetObject() { assertEquals(new Integer(1), VelocityUtil.getObject(new Integer(1), new Integer(2))); assertEquals(new Integer(1), VelocityUtil.getObject(new Integer(1), null)); assertEquals(new Integer(2), VelocityUtil.getObject(null, new Integer(2))); assertNull(VelocityUtil.getObject(null, null)); }