### Question:
AbstractValueSchema implements Serializable { public boolean validate(final String value) { return !StringUtils.equals(value, AbstractValueSchema.MISSING_VALUE) || this.allowMissing; } protected  AbstractValueSchema(final boolean allowMissing); boolean isAllowMissing(); boolean validate(final String value); @Override int hashCode(); @Override boolean equals(final Object obj); @Override final String toString(); static final String MISSING_VALUE; }### Answer:
@Test public void testValidateAllowMissing() { final AbstractValueSchema valueSchema = new AbstractValueSchema(true) { }; assertTrue("Non missing value should always be valid", valueSchema.validate(VALID_VALUE)); assertTrue("Missing value should be valid if specified", valueSchema.validate(AbstractValueSchema.MISSING_VALUE)); }
@Test public void testValidateNotAllowMissing() { final AbstractValueSchema valueSchema = new AbstractValueSchema(false) { }; assertTrue("Non missing value should always be valid", valueSchema.validate(VALID_VALUE)); assertFalse("Missing value should not be valid if specified", valueSchema.validate(AbstractValueSchema.MISSING_VALUE)); }