private <T> Optional<T> tryWithLock(Supplier<T> task)
    {
        return tryWithLock(0, TimeUnit.MILLISECONDS, task);
    }
private < T > Optional < T > tryWithLock ( Supplier < T > task ) { return tryWithLock ( 0 , TimeUnit . MILLISECONDS , task ) ; }
Note: task can not return null