@Override
    public int compareTo(StandardAcl other) {
        int result;
        result = resourceType.compareTo(other.resourceType);
        if (result != 0) return result;
        result = other.resourceName.compareTo(resourceName); // REVERSE sort by resource name.
        if (result != 0) return result;
        result = patternType.compareTo(other.patternType);
        if (result != 0) return result;
        result = operation.compareTo(other.operation);
        if (result != 0) return result;
        result = principal.compareTo(other.principal);
        if (result != 0) return result;
        result = host.compareTo(other.host);
        if (result != 0) return result;
        result = permissionType.compareTo(other.permissionType);
        return result;
    }
@Test
    public void testCompareTo() {
        assertEquals(1, signum(TEST_ACLS.get(0).compareTo(TEST_ACLS.get(1))));
        assertEquals(-1, signum(TEST_ACLS.get(1).compareTo(TEST_ACLS.get(0))));
        assertEquals(-1, signum(TEST_ACLS.get(2).compareTo(TEST_ACLS.get(3))));
        assertEquals(1, signum(TEST_ACLS.get(4).compareTo(TEST_ACLS.get(3))));
        assertEquals(-1, signum(TEST_ACLS.get(3).compareTo(TEST_ACLS.get(4))));
    }