### Question:
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()); }  static boolean matches(String nullableValue, String nullableRegex); static boolean matchesInt(Integer value, Integer required); static boolean matchesSpecification(Specification specification, SpecificationQuery specQuery); static boolean matchesSchemaKey(SchemaKey key, SchemaKeyQuery schemaKeyQuery);  }### Answer:
@Test public void matchesSpecification() { Specification specification = new Specification(); SpecificationQuery query = null; assertTrue(FilterUtility.matchesSpecification(specification, query)); query = SpecificationQuery.builder().build(); assertTrue(FilterUtility.matchesSpecification(specification, query)); query = SpecificationQuery.builder().descriptionRegex(REGEX).build(); assertFalse(FilterUtility.matchesSpecification(specification, query)); query = SpecificationQuery.builder().typeRegex(REGEX).build(); assertFalse(FilterUtility.matchesSpecification(specification, query)); specification = new Specification(MATCH, null, FAIL, null); assertFalse(FilterUtility.matchesSpecification(specification, query)); specification = new Specification(MATCH, null, MATCH, null); assertTrue(FilterUtility.matchesSpecification(specification, query)); }