code: private void buildHosts(Map externalProperties, List<Server> servers, String persistenceUnit,
              final KunderaMetadata kunderaMetadata)
      {
          persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit);
          Properties props = persistenceUnitMetadata.getProperties();
          this.externalProperties = externalProperties;
          String hosts = null;
          String portAsString = null;
  
          if (externalProperties != null)
          {
              hosts = (String) externalProperties.get(PersistenceProperties.KUNDERA_NODES);
              portAsString = (String) externalProperties.get(PersistenceProperties.KUNDERA_PORT);
          }
          if (hosts == null)
          {
              hosts = (String) props.get(PersistenceProperties.KUNDERA_NODES);
          }
          if (portAsString == null)
          {
              portAsString = (String) props.get(PersistenceProperties.KUNDERA_PORT);
          }
  
          if (hosts != null && portAsString != null)
          {
              buildHosts(hosts, portAsString, this.hostsList);
          }
          else if (servers != null && servers.size() >= 1)
          {
              buildHosts(servers, this.hostsList);
          }
      }
docs: Build host array.
  
  @param externalProperties
  @param servers
  @param persistenceUnit