@RequiresApi(api = Build.VERSION_CODES.N)
public Stream<T> stream() {
if (!lock.isWriteLockedByCurrentThread()) throw new RuntimeException(
"Iterators break encapsulation and ignore locking. Write-lock first");
return list.stream();
}
@RequiresApi(api = Build.VERSION_CODES.N)
public Stream<T> stream() {
if (!lock.isWriteLockedByCurrentThread()) throw new RuntimeException(
"Iterators break encapsulation and ignore locking. Write-lock first");
return list.stream();
}