@Test
public void testEncrypt() {

    Mockito.doAnswer((Answer<Void>) mock -> {
        final byte[] bytes = mock.getArgument(0);
        for (int i = 0; i < bytes.length; ++i) {
            bytes[i] = 0x42;
        }
        return null;
    }).when(mockSecureRandom).nextBytes(ArgumentMatchers.any());
    assertEquals(ENCRYPTED_PASSWORD, userService.encrypt(UNENCRYPTED_PASSWORD));
    Mockito.verify(mockSecureRandom).nextBytes(ArgumentMatchers.any());
}