CheckboxDDMFormFieldValueAccessor implements DDMFormFieldValueAccessor<Boolean> { @Override public Boolean getValue( DDMFormFieldValue ddmFormFieldValue, Locale locale) { Value value = ddmFormFieldValue.getValue(); return Boolean.valueOf(value.getString(locale)); }  @Override IntFunction<Boolean[]> getArrayGeneratorIntFunction(); @Override Boolean getValue(
		DDMFormFieldValue ddmFormFieldValue, Locale locale); @Override Boolean getValueForEvaluation(
		DDMFormFieldValue ddmFormFieldValue, Locale locale); @Override boolean isEmpty(DDMFormFieldValue ddmFormFieldValue, Locale locale);  }
@Test public void testGetWithLocalizedValue() { Value value = new LocalizedValue(LocaleUtil.US); value.addString(LocaleUtil.BRAZIL, "true"); value.addString(LocaleUtil.US, "false"); DDMFormFieldValue ddmFormFieldValue = DDMFormValuesTestUtil.createDDMFormFieldValue("Checkbox", value); CheckboxDDMFormFieldValueAccessor checkboxDDMFormFieldValueAccessor = new CheckboxDDMFormFieldValueAccessor(); Assert.assertEquals( Boolean.TRUE, checkboxDDMFormFieldValueAccessor.getValue( ddmFormFieldValue, LocaleUtil.BRAZIL)); Assert.assertEquals( Boolean.FALSE, checkboxDDMFormFieldValueAccessor.getValue( ddmFormFieldValue, LocaleUtil.US)); }
@Test public void testGetWithUnlocalizedValue() { DDMFormFieldValue ddmFormFieldValue = DDMFormValuesTestUtil.createDDMFormFieldValue( "Checkbox", new UnlocalizedValue("true")); CheckboxDDMFormFieldValueAccessor checkboxDDMFormFieldValueAccessor = new CheckboxDDMFormFieldValueAccessor(); Assert.assertEquals( Boolean.TRUE, checkboxDDMFormFieldValueAccessor.getValue( ddmFormFieldValue, LocaleUtil.BRAZIL)); Assert.assertEquals( Boolean.TRUE, checkboxDDMFormFieldValueAccessor.getValue( ddmFormFieldValue, LocaleUtil.US)); }