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
    public void testToIntegerList_whenNotEmpty() {
        List<Integer> result = asIntegerList(new int[]{1, 2, 3, 4});
        assertEquals(asList(1, 2, 3, 4), result);
    }