class FilterUtility {

  public static boolean matchesSpecification(Specification specification, SpecificationQuery specQuery) {
    if (specQuery == null) {
      return true;
    }
    if (specification == null) {
      return false;
    }
    if (!matches(specification.getDescription(), specQuery.getDescriptionRegex())) {
      return false;
    }
    if (!matches(specification.getType(), specQuery.getTypeRegex())) {
      return false;
    }
    return matchesAllTagQueries(specification, specQuery.getTags());
  }

}