### Question:
ProfileSearchDescriptorConverter implements AttributeConverter { @Override public String convert(String attribute) { String descriptor = mapping.get(attribute); if (descriptor == null) { throw new RuntimeException(attribute + " has no valid search descriptor"); } return descriptor; }  @Override String convert(String attribute); @Override Map<String, TYPE> getValueTypeMapping();  }### Answer:
@Test public void testWeCanConvertTheProfileId() throws Exception { String descriptor = new ProfileSearchDescriptorConverter().convert(ProfileItem.ATTRIBUTE_ID); assertEquals(ProfileSearchDescriptor.ID, descriptor); }
@Test public void testWeCanConvertTheProfileName() throws Exception { String descriptor = new ProfileSearchDescriptorConverter().convert(ProfileItem.ATTRIBUTE_NAME); assertEquals(ProfileSearchDescriptor.NAME, descriptor); }
@Test public void testWeCanConvertHasNavigation() throws Exception { String descriptor = new ProfileSearchDescriptorConverter().convert(ProfileItem.FILTER_HAS_NAVIGATION); assertEquals(ProfileSearchDescriptor.PROFILE_ENTRY_NAME, descriptor); }
@Test(expected = RuntimeException.class) public void testTryingToConvertUnexistingDescriptorThrowAnException() { new ProfileSearchDescriptorConverter().convert("someUnsupportedAttribute"); }