public static Deadline soonest ( Deadline ... deadlines ) { Deadline min = null ; if ( deadlines != null ) for ( Deadline deadline : deadlines ) { if ( deadline != null ) { if ( min == null ) min = deadline ; else if ( deadline . getTimeLeft ( ) < min . getTimeLeft ( ) ) { min = deadline ; } } } return min ; }
Retrieve the deadline with the least time remaining until it expires