public static List<Integer> asIntegerList(@Nonnull int[] array) {
        checkNotNull(array, "null array");
        return new AbstractList<>() {
            @Override
            public Integer get(int index) {
                return array[index];
            }

            @Override
            public int size() {
                return array.length;
            }
        };
    }
@Test(expected = NullPointerException.class)
    public void testToIntegerList_whenNull() {
        asIntegerList(null);
    }