DDMFormContextToDDMFormValues implements DDMFormContextDeserializer<DDMFormValues> { protected Value getLocalizedValue(JSONObject jsonObject) { Value value = new LocalizedValue(LocaleUtil.getSiteDefault()); Iterator<String> iterator = jsonObject.keys(); while (iterator.hasNext()) { String languageId = iterator.next(); value.addString( LocaleUtil.fromLanguageId(languageId), jsonObject.getString(languageId)); } return value; }  @Override DDMFormValues deserialize(
			DDMFormContextDeserializerRequest ddmFormContextDeserializerRequest);  }
@Test public void testGetLocalizedValue() { JSONObject jsonObject = new JSONObjectImpl(); String enValue = StringUtil.randomString(); String ptValue = StringUtil.randomString(); jsonObject.put( "en_US", enValue ).put( "pt_BR", ptValue ); Value value1 = DDMFormValuesTestUtil.createLocalizedValue( enValue, ptValue, LocaleUtil.US); Value value2 = _ddmFormContextToDDMFormValues.getLocalizedValue( jsonObject); Assert.assertTrue(Objects.equals(value1, value2)); }