effective-java-3e-source-code
effective-java-3e-source-code copied to clipboard
Update RecursiveTypeBound.java
The original code would cause an NPE if any of the elements in the Collection c is null. This might be the intention, but makes line 14 weird, since an NPE would be thrown on line 13. My suggested modification throws an NPE only when all elements are null. This would be more in line with returning an Optional<E> as suggested in the text.