Here you can find the source of isIntListContinous(List
public static boolean isIntListContinous(List<Integer> list)
//package com.java2s; import java.util.List; public class Main { public static boolean isIntListContinous(List<Integer> list) { if (list.isEmpty()) return true; int curr = list.get(0); for (int i = 0; i < list.size(); i++) { if (list.get(i) != curr) return false; curr++;/* w ww . j av a2s . c om*/ } return true; } }