Field field = new BooleanField(injector.getInstance(WidgetFactory.class));
field.setName("fieldName");
Map<String, String> errors = new HashMap<String, String>();
Boolean value = (Boolean)field.clean(new String []{"qwert"}, errors);
assertFalse(errors.isEmpty());
assertTrue(errors.containsKey("fieldName"));
assertEquals("Unknown value 'qwert'", errors.get("fieldName"));
}