

Catching date-related failures before they become critical (2013) - dantiberian
https://rachelbythebay.com/w/2013/01/03/future/

======
fidz
So instead of

    
    
           boolean needToUninstall() {
             if now > EXPIRATION_TIME
               return true
             else
               return false
           }
    

we need to

    
    
           boolean needToUninstall(givenTime) {
             if givenTime > EXPIRATION_TIME
               return true
             else
               return false
           }
           
           needToUninstall(now) && doUninstall()
    

so the code is now testable. Or simply use dependency injection to change the
value of `now`

Is it hard to pass time as parameter?

