### Question:
Exercise4 { static <A> Integer count(final List<A> list) { throw new UnsupportedOperationException("Exercise 4 count is missing!"); }    }### Answer:
@Test public void shouldCountListElements() { final List<Integer> list = asList(1, 2, 5, 6); final Integer expected = 4; final Integer actual = Exercise4.count(list); assertThat(actual, is(expected)); }
@Test public void shouldCountEmptyList() { final List<String> list = emptyList(); final Integer expected = 0; final Integer actual = Exercise4.count(list); assertThat(actual, is(expected)); }