### Question:
CardsGridComponent { public void enableReadOnlyModeForAllCards() { getCardFrames().forEach(CardFrameComponent::enableReadOnlyMode); } @Inject  CardsGridComponent(final View view,
                              final ManagedInstance<CardFrameComponent> cardFrameInstances); void setupCards(final List<CardComponent> cards); void setEmptyState(final HTMLElement emptyStateElement); void enableReadOnlyModeForAllCards(); HTMLElement getElement();  }### Answer:
@Test public void testEnableReadOnlyModeForAllCards() { final CardFrameComponent frame1 = mock(CardFrameComponent.class); final CardFrameComponent frame2 = mock(CardFrameComponent.class); final List<CardFrameComponent> cardFrames = asList(frame1, frame2); doReturn(cardFrames).when(cardsGrid).getCardFrames(); cardsGrid.enableReadOnlyModeForAllCards(); verify(frame1).enableReadOnlyMode(); verify(frame2).enableReadOnlyMode(); }