private static char[] safeWhitespace(char[] whitespace) {
		if (whitespace == null) throw new IllegalArgumentException("null whitespace");
		if (whitespace == DEFAULT_WHITESPACE) return whitespace;
		int length = whitespace.length;
		if (length > 0) {
			whitespace = whitespace.clone();
			if (length > 1) {
				Arrays.sort(whitespace); // normalize order for equality tests
				if (whitespace[length - 1] > 127) throw new IllegalArgumentException("Non ASCII whitespace character.");
				for (int i = 1; i < length; i++) {
					if (whitespace[i] == whitespace[i - 1]) throw new IllegalArgumentException("Duplicate whitespace character.");
				}
			}
		}
		return whitespace;
	}