public static boolean isSecondNewerThanFirst ( File first , File second ) { boolean isSecondNewerThanFirst = false ; // If file does not exist, it cannot be newer. if ( second . exists ( ) ) { long firstLastModified = first . lastModified ( ) ; long secondLastModified = second . lastModified ( ) ; // 0L is returned if there was any error, so we check if both last // modification stamps are != 0L. if ( firstLastModified != 0L && secondLastModified != 0L ) { isSecondNewerThanFirst = secondLastModified > firstLastModified ; } } return isSecondNewerThanFirst ; }
Checks if tool jar is newer than JUnit jar . If tool jar is newer return true ; false otherwise .