SimpleDataValidator implements CustomMessageValidator { @Override public boolean validate(Message data, Object context) { return validator.validate(data).isEmpty(); } SimpleDataValidator(); @Override boolean validate(Message data, Object context);  }
@Test public void testValidatingQuery() { TestQuery testQuery = new TestQuery("1"); SimpleDataValidator sqv = new SimpleDataValidator(); Assert.assertTrue("The query object is not valid.", sqv.validate(testQuery, null)); }