junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/commons/Dates.java
static Date parse(String date, String pattern, String... patterns) {
		Set<String> set = new HashSet<>();
		set.add(pattern);
		if (patterns != null) {
			addAll(set, patterns);
		}

		for (String p : set) {
			try {
				return df(p).parse(date);
			}
			catch (ParseException ex) {
				// Skip pattern
			}
		}

		return null;
	}
static Date parse(String date, String pattern, String... patterns) {
		Set<String> set = new HashSet<>();
		set.add(pattern);
		if (patterns != null) {
			addAll(set, patterns);
		}

		for (String p : set) {
			try {
				return df(p).parse(date);
			}
			catch (ParseException ex) {
				// Skip pattern
			}
		}

		return null;
	}
Parse date using given pattern.
Note that this method will return null if pattern is not
valid or throws a {@link ParseException}.

@param date Date.
@param pattern Pattern.
@param patterns Other pattern to test.
@return Date, null if pattern is not valid.