### Question:
CpanDataAccess { @Nullable public Component findComponent(final StorageTx tx, final Repository repository, final String name, final String version) { Iterable<Component> components = tx.findComponents( Query.builder() .where(P_NAME).eq(name) .and(P_VERSION).eq(version) .build(), singletonList(repository) ); if (components.iterator().hasNext()) { return components.iterator().next(); } return null; }  @Nullable Component findComponent(final StorageTx tx,
                                 final Repository repository,
                                 final String name,
                                 final String version); @Nullable Asset findAsset(final StorageTx tx, final Bucket bucket, final String assetName); Content saveAsset(final StorageTx tx,
                           final Asset asset,
                           final Supplier<InputStream> contentSupplier,
                           final Payload payload); Content saveAsset(final StorageTx tx,
                           final Asset asset,
                           final Supplier<InputStream> contentSupplier,
                           final String contentType,
                           @Nullable final AttributesMap contentAttributes); Content toContent(final Asset asset, final Blob blob); static final List<HashAlgorithm> HASH_ALGORITHMS; }### Answer:
@Test public void findComponent() { List<Component> list = ImmutableList.of(component); when(tx.findComponents(any(), any())) .thenReturn(list); assertThat(underTest.findComponent(tx, repository, "test", "test"), is(equalTo(component))); }