@Test
public void shouldCacheChildViewWhichWasRequestedPreviously() {

    // given
    val parent = givenParentView();
    val cachedChildren = new SparseArray<View>();
    val viewCache = new ViewCache(parent, cachedChildren);
    // when: getting View for the first time
    val firstTime = viewCache.getView(1);
    // then: requesting child from parent view
    then(parent).should().findViewById(1);
    assertThat(firstTime, is(notNullValue()));
    assertThat(cachedChildren.size(), is(1));
    // when: getting View for the second time
    val secondTime = viewCache.getView(1);
    // then: this view will be returned from the cache
    then(parent).shouldHaveNoMoreInteractions();
    assertThat(secondTime, is(notNullValue()));
    assertThat(cachedChildren.size(), is(1));
}