class 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();

}