Here you can find the source of isLollipop()
public static boolean isLollipop()
//package com.java2s; import android.os.Build; public class Main { public static boolean isLollipop() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; }//from w ww .j a v a2 s. com }