question: private int compareTemplates ( @ NotNull File file1 , @ NotNull File file2 ) { TemplateMetadata template1 = getTemplateMetadata ( file1 ) ; TemplateMetadata template2 = getTemplateMetadata ( file2 ) ; if ( template1 == null ) { return 1 ; } else if ( template2 == null ) { return - 1 ; } else { int delta = template2 . getRevision ( ) - template1 . getRevision ( ) ; if ( delta == 0 ) { delta = ( int ) ( file2 . lastModified ( ) - file1 . lastModified ( ) ) ; } return delta ; } }
target:  Compare two files, and return the one with the HIGHEST revision, and if the same, most recently modified