### Question:
GravatarClient { public List<UserImage> getUserImages(final String password) { checkArgument(StringUtils.isNotEmpty(password), "`password` should not be empty"); final Map<String, String> params = Map.of("password", password); try { final Object response = rpcClient.execute("grav.userimages", new Object[]{params}); return userImageFactory.from(response); } catch (XmlRpcException e) { throw new GravatarClientException("Failed to call `grav.userimages` API", e); } } GravatarClient(final String email); protected  GravatarClient(
        final String email,
        final XmlRpcClient rpcClient,
        final UserImageFactory userImageFactory,
        final StatusFactory statusFactory
    ); List<UserImage> getUserImages(final String password); Map<String, Boolean> useUserImage(
        final String password,
        final String userImage,
        final List<String> addresses
    );  }### Answer:
@Test @SneakyThrows public void getUserImagesPasswordTest() { final Map<String, String> params = ImmutableMap.of("password", PASSWORD); final Object rpcResult = new Object(); final List<UserImage> expected = Collections.emptyList(); when(xmlRpcClient.execute("grav.userimages", new Object[]{params})) .thenReturn(rpcResult); when(userImageFactory.from(rpcResultCaptor.capture())).thenReturn(expected); final List<UserImage> actual = gravatarClient.getUserImages(PASSWORD); assertSame(rpcResult, rpcResultCaptor.getValue()); assertSame(expected, actual); verify(xmlRpcClient).execute("grav.userimages", new Object[]{params}); verify(userImageFactory).from(any()); }
@Test @SneakyThrows public void getUserImagesFailedTest() { expectedException.expect(GravatarClientException.class); final Map<String, String> params = ImmutableMap.of("password", PASSWORD); final XmlRpcException exception = mock(XmlRpcException.class); when(xmlRpcClient.execute("grav.userimages", new Object[]{params})) .thenThrow(exception); gravatarClient.getUserImages(PASSWORD); }
@Test public void getUserImagesEmptyPasswordTest() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("`password` should not be empty"); gravatarClient.getUserImages(StringUtils.EMPTY); }