Java tutorial
//package com.java2s; import java.util.Map; import java.util.Set; import java.util.TreeSet; public class Main { private static boolean isList(Map temp) { Set s = new TreeSet(temp.keySet()); Object[] keyArray = s.toArray(new Object[] {}); for (int i = 0; i < keyArray.length; i++) { if (keyArray[i] instanceof Number) { if (((Number) keyArray[i]).intValue() != i) { return false; } } else { return false; } } return true; } }