@SuppressWarnings("unchecked")
    public static <T> T[] tail(final T[] elements) {
        checkNotNull(elements);

        if (elements.length <= 1) {
            return (T[]) Array.newInstance(elements.getClass().getComponentType(), 0);
        }

        return Arrays.copyOfRange(elements, 1, elements.length);
    }
@Test
    public void should_get_tail() {
        assertThat(Iterables.tail(new Integer[]{1, 2}), is(new Integer[] {2}));
        assertThat(Iterables.tail(new Integer[1]), is(new Integer[0]));
        assertThat(Iterables.tail(new Integer[0]), is(new Integer[0]));
        assertThrows(NullPointerException.class, () -> Iterables.tail(null));
    }