private static DeployedCriteria parse(String optionContext) {
			List<String> list = Arrays.asList(optionContext.split(" "));
			boolean hasDeployed = list.contains("deployed");
			boolean hasUndeployed = list.contains("undeployed");
			if (hasDeployed && !hasUndeployed) {
				return deployed;
			}
			else if (hasUndeployed && !hasDeployed) {
				return undeployed;
			}
			else if (hasDeployed && hasUndeployed) {
				throw new IllegalArgumentException("deployed and undeployed are mutually exclusive");
			}
			else {
				return all;
			}

		}
A grouping header depending on the status of the resource, or {@code null} if no information can be derived /
makes sense.
spring-xd-shell/src/main/java/org/springframework/xd/shell/converter/ExistingXDEntityConverter.java