code: public synchronized Node nonMasterNode() {
          final ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();
          final String name = state.nodes().getMasterNode().getName();
          for (final Node node : nodeList) {
              if (!node.isClosed() && !name.equals(node.settings().get(NODE_NAME))) {
                  return node;
              }
          }
          return null;
      }
docs: Return a non-master node.
  
  @return non-master node