### Question:
SelectItems implements Iterable<SelectItem> { protected final <T> T firstNonNullValue(T... values) { for (T value : values) { if (value != null) { return value; } } return null; } SelectItems(Object value); @SuppressWarnings({ "rawtypes", "unchecked" }) Iterator<SelectItem> iterator();  }### Answer:
@Test public void shouldReturnFirstNonNull() throws Exception { new TestableSelectItems() { @Override public void test() throws Exception { Object v = firstNonNullValue(null, null, "a", "b"); assertThat(v, is((Object) "a")); } }.test(); }
@Test public void shouldSupportFirstNonNullWithAllNulls() throws Exception { new TestableSelectItems() { @Override public void test() throws Exception { Object v = firstNonNullValue(null, null, null); assertThat(v, is(nullValue())); } }.test(); }