PendingTaskCollectionPointer { synchronized Optional<Collection<Task>> getAndSetNull() { final Collection<Task> cur = curTaskCollection; curTaskCollection = null; return Optional.ofNullable(cur); } @Inject private  PendingTaskCollectionPointer(); static PendingTaskCollectionPointer newInstance();  }
@Test public void nullByDefault() { assertFalse(pendingTaskCollectionPointer.getAndSetNull().isPresent()); }