### Question:
G2Client { public HashMap<String, String> fetchImages(String galleryUrl, int albumName) throws GalleryConnectionException { List<NameValuePair> nameValuePairsFetchImages = new ArrayList<NameValuePair>(); nameValuePairsFetchImages.add(FETCH_ALBUMS_IMAGES_CMD_NAME_VALUE_PAIR); nameValuePairsFetchImages.add(new BasicNameValuePair( "g2_form[set_albumName]", "" + albumName)); HashMap<String, String> properties = sendCommandToGallery(galleryUrl, nameValuePairsFetchImages, null); return properties; } G2Client(String userAgent); HashMap<String, String> fetchImages(String galleryUrl, int albumName); HashMap<String, String> fetchAlbums(String galleryUrl); void loginToGallery(String galleryUrl, String user, String password); InputStream getInputStreamFromUrl(String url); int createNewAlbum(String galleryUrl, int parentAlbumName,
			String albumName, String albumTitle, String albumDescription); int sendImageToGallery(String galleryUrl, int albumName,
			File imageFile, String imageName, String summary, String description); String getAuthToken(); void setAuthToken(String authToken); List<Cookie> getSessionCookies(); Collection<G2Picture> extractG2PicturesFromProperties(
			HashMap<String, String> fetchImages); Map<Integer, Album> getAllAlbums(String galleryUrl); Map<Integer, G2Album> extractAlbumFromProperties(
			HashMap<String, String> albumsProperties); Album organizeAlbumsHierarchy(Map<Integer, G2Album> albums); void setRootAlbum(G2Album rootAlbum); G2Album getRootAlbum();  }### Answer:
@Test public void fetchImagesTest() throws GalleryConnectionException { HashMap<String, String> fetchImages = g2ConnectionUtils.fetchImages( galleryUrl, 11); assertTrue("no pictures found",fetchImages.size() != 0); assertTrue("the string image_count could not be found",fetchImages.containsKey("image_count")); assertFalse("the value of image_count was 0",fetchImages.get("image_count").equals("0")); fetchImages = g2ConnectionUtils.fetchImages(galleryUrl, 9999); assertTrue("there were not 3 pictures",fetchImages.size() == 3); }
@Test(expected = GalleryConnectionException.class) public void fetchImagesTest__exception() throws GalleryConnectionException { g2ConnectionUtils.fetchImages("http: 11); }