RFacetUtils { @Nullable public static Component findComponent(final StorageTx tx, final Repository repository, final String name, final String version, final String group) { Iterable<Component> components = tx.findComponents( Query.builder() .where(P_NAME).eq(name) .and(P_VERSION).eq(version) .and(P_GROUP).eq(group) .build(), singletonList(repository) ); if (components.iterator().hasNext()) { return components.iterator().next(); } return null; } private  RFacetUtils(); static Content toContent(final Asset asset, final Blob blob); @Nullable static Component findComponent(final StorageTx tx,
                                        final Repository repository,
                                        final String name,
                                        final String version,
                                        final String group); @Nullable static Asset findAsset(final StorageTx tx, final Bucket bucket, final String assetName); static Iterable<Asset> browseAllAssetsByKind(final StorageTx tx,
                                                      final Bucket bucket,
                                                      final AssetKind assetKind); static Content saveAsset(final StorageTx tx,
                                  final Asset asset,
                                  final Supplier<InputStream> contentSupplier,
                                  final Payload payload); static Content saveAsset(final StorageTx tx,
                                  final Asset asset,
                                  final Supplier<InputStream> contentSupplier,
                                  final String contentType,
                                  @Nullable final AttributesMap contentAttributes); static AssetKind extractAssetKind(final Asset asset); static final List<HashAlgorithm> HASH_ALGORITHMS; }
@Test public void returnFirstComponent() throws Exception { Component component = findComponent(tx, repository, "name", "version", "group"); assertThat(component, is(notNullValue())); }
@Test public void findNoComponents() throws Exception { components.clear(); Component component = findComponent(tx, repository, "name", "version", "group"); assertThat(component, is(equalTo(component))); }