Variable { public static Variable createInteger(Integer value) throws NullPointerException { if (value == null) { throw new NullPointerException(); } return new Variable(INT_TYPE, value); } protected  Variable(int type, Object value); static Variable createString(String value); static Variable createInteger(Integer value); static Variable createFloat(Float value); static Variable createBoolean(Boolean value); static Variable createTable(List<Variable> value); boolean isString(); boolean isInteger(); boolean isFloat(); boolean isBoolean(); boolean isTable(); String getString(); List<Variable> getTable(); Integer getInteger(); float getFloat(); boolean getBoolean(); String get_type(); String get_value();  }
@Test public void testCreateInteger() { Variable v = Variable.createInteger(32); assertEquals(32, v.getInteger().intValue()); v = Variable.createInteger(-1); assertEquals(-1, v.getInteger().intValue()); }
@Test(expected = NullPointerException.class) public void testNullPointerWithCreateInteger() { Variable.createInteger(null); }