### Question:
JedisNodeClient implements JedisClient { @Override public void clean(String sessionsKey) { try(Jedis jedis = this.jedisPool.getResource()) { Set<String> sessions = jedis.smembers(sessionsKey); String[] sessionsArray = sessions.toArray(new String[sessions.size()]); Transaction t = jedis.multi(); t.srem(sessionsKey, sessionsArray); t.del(sessionsArray); t.exec(); } } JedisNodeClient(JedisPool jedisPool); @Override Set<String> getSessions(String sessionsKey); @Override void del(String sessionsKey, String key); @Override Integer count(String sessionsKey); @Override byte[] get(String key); @Override void set(String key, String sessionsKey, byte[] session, int timeout); @Override void clean(String sessionsKey); @Override void close();  }### Answer:
@Test public void clean() throws UnsupportedEncodingException { HashSet<String> sessions = new HashSet<String>(Arrays.asList("key")); String[] sessionsArray = sessions.toArray(new String[sessions.size()]); when(this.jedis.smembers(SESSIONS_KEY)).thenReturn(sessions); this.jedisNodeClient.clean( SESSIONS_KEY); verify(this.transaction, times(1)).srem(SESSIONS_KEY, sessionsArray); verify(this.transaction, times(1)).del(sessionsArray); verify(this.transaction, times(1)).exec(); verify(this.jedis, times(1)).close(); }