public static <T> T head(final T[] elements) {
        checkNotNull(elements);

        if (elements.length == 0) {
            return null;
        }

        return elements[0];
    }
@Test
    public void should_get_head() {
        assertThat(Iterables.head(new Integer[]{1, 2}), is(1));
        assertThat(Iterables.head(new Integer[]{1}), is(1));
        assertThat(Iterables.head(new Integer[0]), nullValue());
        assertThrows(NullPointerException.class, () -> Iterables.head(null));
    }