### Question:
G3Client implements IG3Client { public List<Item> getAlbumAndSubAlbums(int albumId) throws G3GalleryException { List<Item> items = new ArrayList<Item>(); Item item = getItems(albumId, items, "album"); items.add(0, item); return items; } G3Client(String galleryUrl, String userAgent); Item getItem(int itemId); int createItem(Entity entity, File file); void updateItem(Entity entity); void deleteItem(int itemId); String getApiKey(); List<Item> getAlbumAndSubAlbumsAndPictures(int albumId); List<Item> getAlbumAndSubAlbums(int albumId); List<Item> getPictures(int albumId); InputStream getPhotoInputStream(String url); void setPassword(String password); void setUsername(String username); void setExistingApiKey(String existingApiKey); String getExistingApiKey(); boolean isUsingRewrittenUrls(); void setUsingRewrittenUrls(boolean isUsingRewrittenUrls);  }### Answer:
@Test public void getAlbumAndSubAlbumsTest() throws G3GalleryException { List<Item> subAlbums = itemClient.getAlbumAndSubAlbums(11); boolean foundRecentlyAddedAlbum = false; for (Item album : subAlbums) { if (album.getEntity().getId() == createdAlbumId) { foundRecentlyAddedAlbum = true; } } assertTrue(foundRecentlyAddedAlbum); subAlbums = itemClient.getAlbumAndSubAlbums(172); for (Item album : subAlbums) { if (!album.getEntity().getType().equals("album")) { fail("found some other types than album"); } } }