### Question:
FluentElementInjectionSupportValidator { boolean isListOfComponent(Field field) { return isFieldListOf(field, genericType -> componentsManager.isComponentClass(genericType)); } FluentElementInjectionSupportValidator(ComponentsManager componentsManager);   }### Answer:
@Test public void shouldReturnFalseWhenFieldIsNotList() throws NoSuchFieldException { Field webElementField = getField("webElement"); assertThat(validator.isListOfComponent(webElementField)).isFalse(); }
@Test public void shouldReturnFalseWhenFieldIsNotListOfComponent() throws NoSuchFieldException { when(componentsManager.isComponentClass(WebElement.class)).thenReturn(false); Field listOfWebElementsField = getField("listOfWebElements"); assertThat(validator.isListOfComponent(listOfWebElementsField)).isFalse(); }
@Test public void shouldReturnFalseWhenFieldHasNoGenericTypeForListOfComponent() throws NoSuchFieldException { Field listWithoutGenericTypeField = getField("listWithoutGenericType"); assertThat(validator.isListOfComponent(listWithoutGenericTypeField)).isFalse(); }
@Test public void shouldReturnTrueWhenFieldIsListOfComponent() throws NoSuchFieldException { when(componentsManager.isComponentClass(TestComponent.class)).thenReturn(true); Field listOfComponentsField = getField("listOfComponents"); assertThat(validator.isListOfComponent(listOfComponentsField)).isTrue(); }