I want to call the add
function of an HashSet with some delay, but without blocking the current thread. Is there an easy solution to achieve something like this:
Utils.sleep(1000, myHashSet.add(foo)); //added after 1 second//code here runs immediately without delay...