final ImmutableNumberSubTypeConstraint subTypeConstraint =
CONSTRAINT_FACTORY.getNumberSubTypeConstraint(Integer.class);
numberType.setNumberSubTypeConstraint(subTypeConstraint);
// check constraint with right value
numberValue.setValue(new Integer(6));
errors = numberType.verify(numberValue);
assertEquals(0, errors.size());
// check constraint violation
numberValue.setValue(new Long(8));
errors = numberType.verify(numberValue);
assertEquals(1, errors.size());