public static AbstractList<?> fromArray(Object array) {
Class<?> componentType = array.getClass().getComponentType();
if (componentType == byte.class)
return new ByteList((byte[]) array);
else if (componentType == Byte.class)
return new ByteList((Byte[]) array);
else if (componentType == short.class)
return new ShortList((short[]) array);
else if (componentType == Short.class)
return new ShortList((Short[]) array);