### Question:
FluentListAssert extends AbstractFluentAssert<FluentListAssert, FluentList> implements ListStateAssert, ListAttributeAssert { @Override public FluentListAssert hasId(String idToFind) { List<String> actualIds = requiresNonEmpty(actual.ids()); if (!actualIds.contains(idToFind)) { failWithMessage("No selected elements have id: " + idToFind + ". Actual ids found : " + actualIds); } return this; } FluentListAssert(FluentList<? extends FluentWebElement> actual); @Override FluentListAssert isEmpty(); @Override FluentListAssert isNotEmpty(); @Override FluentListAssert hasSize(int expectedSize); @Override FluentListSizeBuilder hasSize(); @Override FluentListAssert hasText(String textToFind); @Override FluentListAssert hasTextContaining(String textToFind); @Override FluentListAssert hasTextMatching(String regexToBeMatched); @Override FluentListAssert hasNotText(String textToFind); @Override FluentListAssert hasNotTextContaining(String textToFind); @Override FluentListAssert hasId(String idToFind); @Override FluentListAssert hasClass(String classToFind); @Override FluentListAssert hasClasses(String... classesToFind); @Override FluentListAssert hasNotClass(String htmlClass); @Override FluentListAssert hasNotClasses(String... htmlClasses); @Override FluentListAssert hasValue(String value); @Override FluentListAssert hasName(String name); @Override FluentListAssert hasTagName(String tagName); @Override FluentListAssert hasDimension(Dimension dimension); @Override FluentListAssert hasAttributeValue(String attribute, String value); @Override ListAssert<String> hasAttribute(String attribute); @Override FluentListAssert hasNotAttribute(String attribute);  }### Answer:
@Test public void testHasIdOk() { when(fluentList.ids()).thenReturn(singletonList("some-id")); listAssert.hasId("some-id"); }
@Test public void testHasIdKo() { when(fluentList.ids()).thenReturn(singletonList("other-id")); assertThatAssertionErrorIsThrownBy(() -> listAssert.hasId("some-id")) .hasMessage("No selected elements have id: some-id. Actual ids found : [other-id]"); }
@Test public void testHasIdEmptyKo() { when(fluentList.ids()).thenReturn(emptyList()); assertThatAssertionErrorIsThrownBy(() -> listAssert.hasId("some-id")) .hasMessage("List is empty. Please make sure you use correct selector."); }