### Question:
Community extends DSpaceObject { public void setMetadata(String field, String value)throws MissingResourceException { if ((field.trim()).equals("name") && (value == null || value.trim().equals(""))) { try { value = I18nUtil.getMessage("org.dspace.workflow.WorkflowManager.untitled"); } catch (MissingResourceException e) { value = "Untitled"; } } if(value == null) { communityRow.setColumnNull(field); } else { communityRow.setColumn(field, value.trim()); } modifiedMetadata = true; addDetails(field); } Community(Context context, TableRow row); static Community find(Context context, int id); static Community create(Community parent, Context context); static Community create(Community parent, Context context, String handle); static Community[] findAll(Context context); static Community[] findAllTop(Context context); int getID(); String getHandle(); String getMetadata(String field); void setMetadata(String field, String value); String getName(); Bitstream getLogo(); Bitstream setLogo(InputStream is); void update(); Group createAdministrators(); void removeAdministrators(); Group getAdministrators(); Collection[] getCollections(); Community[] getSubcommunities(); Community getParentCommunity(); Community[] getAllParents(); Collection createCollection(); Collection createCollection(String handle); void addCollection(Collection c); Community createSubcommunity(); Community createSubcommunity(String handle); void addSubcommunity(Community c); void removeCollection(Collection c); void removeSubcommunity(Community c); void delete(); boolean equals(Object other); int hashCode(); int getType(); boolean canEditBoolean(); void canEdit(); int countItems(); DSpaceObject getAdminObject(int action); DSpaceObject getParentObject();  }### Answer:
@Test public void testSetMetadata() { String name = "name"; String sdesc = "short description"; String itext = "introductory text"; String logo = "1"; String copy = "copyright declaration"; String sidebar = "side bar text"; c.setMetadata("name", name); c.setMetadata("short_description", sdesc); c.setMetadata("introductory_text", itext); c.setMetadata("logo_bitstream_id", logo); c.setMetadata("copyright_text", copy); c.setMetadata("side_bar_text", sidebar); assertThat("testSetMetadata 0",c.getMetadata("name"), equalTo(name)); assertThat("testSetMetadata 1",c.getMetadata("short_description"), equalTo(sdesc)); assertThat("testSetMetadata 2",c.getMetadata("introductory_text"), equalTo(itext)); assertThat("testSetMetadata 3",c.getMetadata("logo_bitstream_id"), equalTo(logo)); assertThat("testSetMetadata 4",c.getMetadata("copyright_text"), equalTo(copy)); assertThat("testSetMetadata 5",c.getMetadata("side_bar_text"), equalTo(sidebar)); }