class LastModifiedResourceComparator implements Comparator<Resource> {

	/**
	 * Compare the two resources by last modified time, so that a sorted list of resources
	 * will have oldest first.
	 * @throws IllegalArgumentException if one of the resources doesn't exist or its last
	 * modified date cannot be determined
	 *
	 * @see Comparator#compare(Object, Object)
	 */
	@Override
	public int compare(Resource r1, Resource r2) {<FILL_FUNCTION_BODY>}

}

		Assert.isTrue(r1.exists(), "Resource does not exist: " + r1);
		Assert.isTrue(r2.exists(), "Resource does not exist: " + r2);
		try {
			long diff = r1.getFile().lastModified() - r2.getFile().lastModified();
			return diff > 0 ? 1 : diff < 0 ? -1 : 0;
		}
		catch (IOException e) {
			throw new IllegalArgumentException("Resource modification times cannot be determined (unexpected).", e);
		}
	
<no_super_class>