scaling java
Apr. 10th, 2017 03:09 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
public static <T> T headOrNull(Iterable<T> ts) { Iterator<T> it = ts.iterator(); return it.hasNext() ? it.next() : null; }
public static <T> T headOrNull(Iterable<T> ts) { Iterator<T> it = ts.iterator(); return it.hasNext() ? it.next() : null; }