Check that the provided Collection is not empty).

@param collection collection to check
@param parameterName name of the parameter to display in the error message
170511
public static void notEmpty(final Collection<?> collection, final String parameterName) {
		if (collection.isEmpty()) {
			throw new IllegalArgumentException("\"" + parameterName + "\" must not be null or empty, but was: " + collection);
		}
	}
793544
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){
    List<Pair> params = new ArrayList<Pair>();

    // preconditions
    if (name == null || name.isEmpty() || value == null) return params;

    Collection<?> valueCollection = null;
    if (value instanceof Collection<?>) {
      valueCollection = (Collection<?>) value;
    } else {
      params.add(new Pair(name, parameterToString(value)));
      return params;
    }

    if (valueCollection.isEmpty()){
      return params;
    }

    // get the collection format
    collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv

    // create the params based on the collection format
    if (collectionFormat.equals("multi")) {
      for (Object item : valueCollection) {
        params.add(new Pair(name, parameterToString(item)));
      }

      return params;
    }

    String delimiter = ",";

    if (collectionFormat.equals("csv")) {
      delimiter = ",";
    } else if (collectionFormat.equals("ssv")) {
      delimiter = " ";
    } else if (collectionFormat.equals("tsv")) {
      delimiter = "\t";
    } else if (collectionFormat.equals("pipes")) {
      delimiter = "|";
    }

    StringBuilder sb = new StringBuilder() ;
    for (Object item : valueCollection) {
      sb.append(delimiter);
      sb.append(parameterToString(item));
    }

    params.add(new Pair(name, sb.substring(1)));

    return params;
  }
403410
private boolean isNullOrEmpty(Object paramValue) {
        boolean isNullOrEmpty = false;
        if (paramValue == null) {
            isNullOrEmpty = true;
        }
        if (paramValue instanceof String) {
            if (((String) paramValue).trim().equalsIgnoreCase("")) {
                isNullOrEmpty = true;
            }
        } else if (paramValue instanceof List) {
            return ((List) paramValue).isEmpty();
        }
        return isNullOrEmpty;
    }
88843
private static void validateAsMongoDBCollectionName(String collectionName) {
		Contracts.assertStringParameterNotEmpty( collectionName, "requestedName" );
		//Yes it has some strange requirements.
		if ( collectionName.startsWith( "system." ) ) {
			throw log.collectionNameHasInvalidSystemPrefix( collectionName );
		}
		else if ( collectionName.contains( "\u0000" ) ) {
			throw log.collectionNameContainsNULCharacter( collectionName );
		}
		else if ( collectionName.contains( "$" ) ) {
			throw log.collectionNameContainsDollarCharacter( collectionName );
		}
	}
737372
public void setParameterValues(java.util.Collection<ParameterValue> parameterValues) {
        if (parameterValues == null) {
            this.parameterValues = null;
            return;
        }

        this.parameterValues = new com.amazonaws.internal.SdkInternalList<ParameterValue>(parameterValues);
    }
813863
public void setParameterGroupNames(java.util.Collection<String> parameterGroupNames) {
        if (parameterGroupNames == null) {
            this.parameterGroupNames = null;
            return;
        }

        this.parameterGroupNames = new java.util.ArrayList<String>(parameterGroupNames);
    }
170913
public static void notEmpty(Collection collection, String name) {
    notNull(collection, name);

    if (collection.isEmpty()) {
      throw new IllegalArgumentException(name + " must not be empty");
    }
  }
1199361
protected void checkCollectionType(Collection c) {
        if (type != null) {
            for (Object element : c) {
                checkType(element);
            }
        }
    }
1274939
public static void assertNotEmpty(final Collection<?> collection, final StatusType status) {
		RESTAssert.assertNotNull(collection, status);
		RESTAssert.assertFalse(collection.isEmpty(), status);
	}
1283104
public static <T> Collection<T> notEmpty(Collection<T> collection) throws IllegalArgumentException {
		return notEmpty(collection, "[Assertion failed] - this collection must not be empty: it must contain at least 1 element");
	}
482115
public static <T extends Collection<?>> T checkNonEmpty(T collection, String name) {
        checkNotNull(collection, name);
        checkPositive(collection.size(), name + ".size");
        return collection;
    }
1370296
private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
        ZkStateReader zkStateReader = server.getZkStateReader();
        zkStateReader.updateClusterState(true);
        ClusterState clusterState = zkStateReader.getClusterState();
        return clusterState.getCollectionOrNull(collection) != null;
    }
551367
public static void notNullOrEmpty(Object[] parameter, String name) throws IllegalArgumentException {
		if (parameter == null || parameter.length == 0) {
			throw new IllegalArgumentException(name + " parameter is empty.");
		}
	}
858727
private function assertAllNonEmptyString(array $values, $parameterName)
    {
        foreach ($values as $value) {
            $this->assertNonEmptyString(
                $value,
                $parameterName,
                'Elements of "%s" must be non-empty strings, element of type "%s" given'
            );
        }
    }
372289
private static void setCollectionParam(String name, List<?> values) throws ConfigurationException {
        try {
            Field field = config.getClass().getDeclaredField(name);
            Class<?> fieldClass = field.getType();
            if (Map.class.isAssignableFrom(fieldClass)) {
                setMapParam(field, values);
            } else if (List.class.isAssignableFrom(fieldClass)) {
                setListParam(field, values);
            } else {
                throw new ConfigurationException("Invalid value type for parameter: " + name);
            }
        } catch (SecurityException | NoSuchFieldException e) {
            throw new ConfigurationException("Unknown configuration parameter: " + name);
        }
    }
154328
public List/*< String >*/ getParameters( String name )
    {
        if ( _parameters == null || !_parameters.hasParameters())
            return Collections.EMPTY_LIST;
        else {

            List parameters = _parameters.getParameterValues(name);
            if(parameters == null)
                return Collections.EMPTY_LIST;
            else return Collections.unmodifiableList(parameters);
        }
    }
422447
@Override
  public boolean collectionExists(String collectionName) {
    CollectionMetaData collectionMeta = cmdMap.get(collectionName);
    if(null == collectionMeta) {
      return false;
    }
    collectionMeta.getCollectionLock().readLock().lock();
    try {
      return collectionsRef.get().containsKey(collectionName);
    } finally {
      collectionMeta.getCollectionLock().readLock().unlock();
    }
  }