### Question:
Collection extends IRODSDomainObject { public String getCollectionLastPathComponent() { int lastSlash = collectionName.lastIndexOf('/'); if (lastSlash == -1) { return ""; } return collectionName.substring(lastSlash + 1); }  int getCollectionId(); void setCollectionId(final int collectionId); boolean inheritanceSet(); String getCollectionName(); void setCollectionName(final String collectionName); String getCollectionLastPathComponent(); String getCollectionParentName(); String getAbsolutePath(); void setCollectionParentName(final String collectionParentName); String getCollectionOwnerName(); void setCollectionOwnerName(final String collectionOwnerName); String getCollectionOwnerZone(); void setCollectionOwnerZone(final String collectionOwnerZone); String getCollectionMapId(); void setCollectionMapId(final String collectionMapId); String getCollectionInheritance(); void setCollectionInheritance(final String collectionInheritance); String getComments(); void setComments(final String comments); String getInfo1(); void setInfo1(final String info1); String getInfo2(); void setInfo2(final String info2); Date getCreatedAt(); void setCreatedAt(final Date createdAt); Date getModifiedAt(); void setModifiedAt(final Date modifiedAt); @Override String toString(); String getObjectPath(); void setObjectPath(final String objectPath); SpecColType getSpecColType(); void setSpecColType(final SpecColType specColType); boolean isProxy(); void setProxy(final boolean isProxy);  }### Answer:
@Test public final void testGetCollectionLastPathComponent() { String path = "a/path/to/a/collection"; Collection collection = new Collection(); collection.setCollectionName(path); Assert.assertEquals("collection", collection.getCollectionLastPathComponent()); }