As you hopefully know you can use lambdas in Java 8, for example to replace anonymous methods.
An example can be seen here of Java 7 vs Java 8:
Runna
You can also create a Timer easily with lambdas from the Swing API if you want (but not with TimerTask) :
new javax.swing.Timer(1000, (ae) -> this::checkDirectory).start();