### Question:
Gravatar { public List<UserImage> getUserImages() { try { return gravatarClient.getUserImages(password); } catch (GravatarClientException e) { throw new GravatarException(e); } } Gravatar(
        final GravatarClient gravatarClient,
        final String password
    );  Gravatar(
        final GravatarClient gravatarClient,
        final String password,
        final Random random
    ); List<UserImage> getUserImages(); void chooseImage(
        final List<String> images,
        final List<String> addresses
    );  }### Answer:
@Test public void getUserImagesTest() { final List<UserImage> userImages = Collections.emptyList(); when(gravatarClient.getUserImages(PASSWORD)).thenReturn(userImages); assertSame(userImages, gravatar.getUserImages()); verify(gravatarClient).getUserImages(PASSWORD); }
@Test public void getUserImagesClientExceptionTest() { expectedException.expect(GravatarException.class); when(gravatarClient.getUserImages(PASSWORD)) .thenThrow(gravatarClientException); gravatar.getUserImages(); }