static S longestString(Collection l) { S longest; int n = -1; if (l != null) for (S s : l) { int l = l(s); if (l > n) { n = l; longest = s; } } ret longest; }