### Question:
LocalizedFieldNames { public Lookup createLookup(List<String> keys) { return new LookupImpl(keys); }  void setMessageSource(MessageSource messageSource); Lookup createLookup(List<String> keys);  }### Answer:
@Test public void backAndForth() { LocalizedFieldNames.Lookup lookup = localizedFieldNames.createLookup(Arrays.asList("dc.title")); final Locale english = new Locale("en"); String title = lookup.toLocalizedName("dc_title", english); Assert.assertEquals("Title", title); String fieldName = lookup.toFieldName(title, english); Assert.assertEquals("dc_title", fieldName); }
@Test public void multiWord() { LocalizedFieldNames.Lookup lookup = localizedFieldNames.createLookup(Arrays.asList("dcterms.isReferencedBy")); final Locale english = new Locale("en"); String fieldName = lookup.toFieldName("isreferENCedby", english); Assert.assertEquals("dcterms_isReferencedBy", fieldName); }