Here you can find the source of getFirstItemOrNull(List
public static String getFirstItemOrNull(List<String> items)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String getFirstItemOrNull(List<String> items) { return items == null || items.size() == 0 ? null : items.get(0); }//from w ww . j a va 2 s. c o m }