### Question:
Collection extends DSpaceObject { public DSpaceObject getAdminObject(int action) throws SQLException { DSpaceObject adminObject = null; Community community = null; Community[] communities = getCommunities(); if (communities != null && communities.length > 0) { community = communities[0]; } switch (action) { case Constants.REMOVE: if (AuthorizeConfiguration.canCollectionAdminPerformItemDeletion()) { adminObject = this; } else if (AuthorizeConfiguration.canCommunityAdminPerformItemDeletion()) { adminObject = community; } break; case Constants.DELETE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = community; } break; default: adminObject = this; break; } return adminObject; } Collection(Context context, TableRow row); static Collection find(Context context, int id); static Collection[] findAll(Context context); ItemIterator getItems(); ItemIterator getAllItems(); int getID(); String getHandle(); String getMetadata(String field); void setMetadata(String field, String value); String getName(); Bitstream getLogo(); Bitstream setLogo(InputStream is); Group createWorkflowGroup(int step); void setWorkflowGroup(int step, Group g); Group getWorkflowGroup(int step); Group createSubmitters(); void removeSubmitters(); Group getSubmitters(); Group createAdministrators(); void removeAdministrators(); Group getAdministrators(); String getLicense(); String getLicenseCollection(); boolean hasCustomLicense(); void setLicense(String license); Item getTemplateItem(); void createTemplateItem(); void removeTemplateItem(); void addItem(Item item); void removeItem(Item item); void update(); boolean canEditBoolean(); boolean canEditBoolean(boolean useInheritance); void canEdit(); void canEdit(boolean useInheritance); Community[] getCommunities(); @Override boolean equals(Object other); @Override int hashCode(); int getType(); static Collection[] findAuthorized(Context context, Community comm,
            int actionID); int countItems(); DSpaceObject getAdminObject(int action); @Override DSpaceObject getParentObject();  }### Answer:
@Test @Override public void testGetAdminObject() throws SQLException { assertThat("testGetAdminObject 0", (Collection)c.getAdminObject(Constants.REMOVE), equalTo(c)); assertThat("testGetAdminObject 1", (Collection)c.getAdminObject(Constants.ADD), equalTo(c)); assertThat("testGetAdminObject 2", c.getAdminObject(Constants.DELETE), nullValue()); assertThat("testGetAdminObject 3", (Collection)c.getAdminObject(Constants.ADMIN), equalTo(c)); }