Here you can find the source of singleValue(List l)
public static <T> T singleValue(List l)
//package com.java2s; // modify it under the terms of the GNU General Public License import java.util.List; public class Main { public static <T> T singleValue(List l) { if (l == null || l.isEmpty()) return null; else//from w w w.j a va 2 s. co m return (T) l.get(0); } }