Here you can find the source of coalesce(T... ts)
@SuppressWarnings("unchecked") public static <T> T coalesce(T... ts)
//package com.java2s; //License from project: Open Source License public class Main { @SuppressWarnings("unchecked") public static <T> T coalesce(T... ts) { for (T t : ts) { if (t != null) return t; }/*from www . j a v a 2 s. c o m*/ return null; } }