code: @Given("^I connect to Elasticsearch cluster at host '(.+?)'( using native port '(.+?)')?( using cluster name '(.+?)')?$")
      public void connectToElasticSearch(String host, String foo, String nativePort, String bar, String clusterName) throws DBException, UnknownHostException, NumberFormatException {
          LinkedHashMap<String, Object> settings_map = new LinkedHashMap<String, Object>();
          if (clusterName != null) {
              settings_map.put("cluster.name", clusterName);
          } else {
              settings_map.put("cluster.name", ES_DEFAULT_CLUSTER_NAME);
          }
          commonspec.getElasticSearchClient().setSettings(settings_map);
          if (nativePort != null) {
              commonspec.getElasticSearchClient().setNativePort(Integer.valueOf(nativePort));
          } else {
              commonspec.getElasticSearchClient().setNativePort(ES_DEFAULT_NATIVE_PORT);
          }
          commonspec.getElasticSearchClient().setHost(host);
          commonspec.getElasticSearchClient().connect();
      }
docs: Connect to ElasticSearch using custom parameters
  
  @param host        ES host
  @param foo         regex needed to match method
  @param nativePort  ES port
  @param bar         regex needed to match method
  @param clusterName ES clustername
  @throws DBException           exception
  @throws UnknownHostException  exception
  @throws NumberFormatException exception