@Test
public void testEsVersion5() throws Exception {

    NodeChecker nodeChecker = new NodeChecker(jestClient, clientConfig);
    JestResult result = new JestResult(new Gson());
    result.setJsonMap(ImmutableMap.<String, Object>of(
            "ok", "true",
            "nodes", ImmutableMap.of(
                    "node_name", ImmutableMap.of(
                            "version",      "5.0.1",
                            "http",             ImmutableMap.of("publish_address",  "192.168.2.7:9200")
                    )
            )
    ));
    result.setSucceeded(true);
    when(jestClient.execute(isA(Action.class))).thenReturn(result);
    nodeChecker.runOneIteration();
    verify(jestClient).execute(isA(Action.class));
    ArgumentCaptor<LinkedHashSet> argument = ArgumentCaptor.forClass(LinkedHashSet.class);
    verify(jestClient).setServers(argument.capture());
    verifyNoMoreInteractions(jestClient);
    Set servers = argument.getValue();
    assertEquals(1, servers.size());
    assertEquals("http://192.168.2.7:9200", servers.iterator().next());
}