code: private Pair<BasicDBList, List<ServerAddress>> getSplitDataCollectionShardEnviroment(Map<String, String[]> shards,
                                                                                           String dbName,
                                                                                           String collectionName) {
          MongoClient mongoClient = null;
          try {
              Set<String> keys = shards.keySet();
  
              for (String key : keys) {
  
                  List<ServerAddress> addressList = getServerAddressList(Arrays.asList(shards.get(key)));
  
                  mongoClient = new MongoClient(addressList);
  
                  BasicDBList dbList = getSplitData(mongoClient.getDB(dbName).getCollection(collectionName));
  
                  if (dbList != null) {
                      return Pair.create(dbList, addressList);
                  }
              }
          } catch (UnknownHostException e) {
              throw new DeepGenericException(e);
          } finally {
              if (mongoClient != null) {
                  mongoClient.close();
              }
  
          }
  
          return null;
  
      }
docs: Gets split data collection shard enviroment.
  
  @param shards         the shards
  @param dbName         the db name
  @param collectionName the collection name
  @return the split data collection shard enviroment