test_class.file: fluxtream-core/src/test/java/org/fluxtream/core/domain/TagFilterTest.java
test_class.identifier: TagFilterTest
test_case.body: @Test
      public void testCreateMethod() {
          final List<String> emptyList = new ArrayList<String>();
          final List<String> oneTag = Arrays.asList("foo");
          final List<String> multipleTags = Arrays.asList("foo", "bar");
          final List<String> tagsWithOneEmptyItem = Arrays.asList("foo", "");
          final List<String> tagsWithDuplicateItems = Arrays.asList("foo", "Foo", "bar", "  bar ");
          final List<String> tagsWithAllEmptyItems = Arrays.asList("\t", " ", "");
  
          Assert.assertNull(TagFilter.create(null, null));
          Assert.assertNull(TagFilter.create(null, TagFilter.FilteringStrategy.ALL));
          Assert.assertNull(TagFilter.create(null, TagFilter.FilteringStrategy.ANY));
          Assert.assertNull(TagFilter.create(null, TagFilter.FilteringStrategy.NONE));
  
          Assert.assertNull(TagFilter.create(emptyList, null));
          Assert.assertNull(TagFilter.create(emptyList, TagFilter.FilteringStrategy.ALL));
          Assert.assertNull(TagFilter.create(emptyList, TagFilter.FilteringStrategy.ANY));
          Assert.assertNull(TagFilter.create(emptyList, TagFilter.FilteringStrategy.NONE));
          Assert.assertNull(TagFilter.create(tagsWithAllEmptyItems, TagFilter.FilteringStrategy.ALL));
          Assert.assertNull(TagFilter.create(tagsWithAllEmptyItems, TagFilter.FilteringStrategy.ANY));
          Assert.assertNull(TagFilter.create(tagsWithAllEmptyItems, TagFilter.FilteringStrategy.NONE));
  
          testUntagged(TagFilter.create(null, TagFilter.FilteringStrategy.UNTAGGED));
          testUntagged(TagFilter.create(oneTag, TagFilter.FilteringStrategy.UNTAGGED));
          testUntagged(TagFilter.create(multipleTags, TagFilter.FilteringStrategy.UNTAGGED));
          testUntagged(TagFilter.create(tagsWithOneEmptyItem, TagFilter.FilteringStrategy.UNTAGGED));
          testUntagged(TagFilter.create(tagsWithDuplicateItems, TagFilter.FilteringStrategy.UNTAGGED));
          testUntagged(TagFilter.create(tagsWithAllEmptyItems, TagFilter.FilteringStrategy.UNTAGGED));
  
          testTagFilter(TagFilter.create(oneTag, TagFilter.FilteringStrategy.ALL), TagFilter.FilteringStrategy.ALL, 1, new String[]{"facet.tags like '%,foo,%'"});
          testTagFilter(TagFilter.create(multipleTags, TagFilter.FilteringStrategy.ALL), TagFilter.FilteringStrategy.ALL, 2, new String[]{"facet.tags like '%,foo,%'", "AND", "facet.tags like '%,bar,%'"});
          testTagFilter(TagFilter.create(tagsWithDuplicateItems, TagFilter.FilteringStrategy.ALL), TagFilter.FilteringStrategy.ALL, 2, new String[]{"facet.tags like '%,foo,%'", "AND", "facet.tags like '%,bar,%'"});
          testTagFilter(TagFilter.create(tagsWithOneEmptyItem, TagFilter.FilteringStrategy.ALL), TagFilter.FilteringStrategy.ALL, 1, new String[]{"facet.tags like '%,foo,%'"});
  
          testTagFilter(TagFilter.create(oneTag, TagFilter.FilteringStrategy.ANY), TagFilter.FilteringStrategy.ANY, 1, new String[]{"facet.tags like '%,foo,%'"});
          testTagFilter(TagFilter.create(multipleTags, TagFilter.FilteringStrategy.ANY), TagFilter.FilteringStrategy.ANY, 2, new String[]{"facet.tags like '%,foo,%'", "OR", "facet.tags like '%,bar,%'"});
          testTagFilter(TagFilter.create(tagsWithDuplicateItems, TagFilter.FilteringStrategy.ANY), TagFilter.FilteringStrategy.ANY, 2, new String[]{"facet.tags like '%,foo,%'", "OR", "facet.tags like '%,bar,%'"});
          testTagFilter(TagFilter.create(tagsWithOneEmptyItem, TagFilter.FilteringStrategy.ANY), TagFilter.FilteringStrategy.ANY, 1, new String[]{"facet.tags like '%,foo,%'"});
  
          testTagFilter(TagFilter.create(oneTag, TagFilter.FilteringStrategy.NONE), TagFilter.FilteringStrategy.NONE, 1, new String[]{"facet.tags is NULL OR (facet.tags NOT like '%,foo,%')"});
          testTagFilter(TagFilter.create(multipleTags, TagFilter.FilteringStrategy.NONE), TagFilter.FilteringStrategy.NONE, 2, new String[]{"facet.tags is NULL OR (", "facet.tags NOT like '%,foo,%'", "AND", "facet.tags NOT like '%,bar,%'",")"});
          testTagFilter(TagFilter.create(tagsWithDuplicateItems, TagFilter.FilteringStrategy.NONE), TagFilter.FilteringStrategy.NONE, 2, new String[]{"facet.tags is NULL OR (", "facet.tags NOT like '%,foo,%'", "AND", "facet.tags NOT like '%,bar,%'", ")"});
          testTagFilter(TagFilter.create(tagsWithOneEmptyItem, TagFilter.FilteringStrategy.NONE), TagFilter.FilteringStrategy.NONE, 1, new String[]{"facet.tags is NULL OR (facet.tags NOT like '%,foo,%')"});
      }
test_case.class_method_signature: TagFilterTest.testCreateMethod()
test_case.full_signature: @Test public void testCreateMethod()
test_case.identifier: testCreateMethod
test_case.invocations: asList asList asList asList asList assertNull create assertNull create assertNull create assertNull create assertNull create assertNull create assertNull create assertNull create assertNull create assertNull create assertNull create testUntagged create testUntagged create testUntagged create testUntagged create testUntagged create testUntagged create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create testTagFilter create
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateMethod()
focal_class.declarator: LOG = Logger.getLogger(TagFilter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = Logger.getLogger(TagFilter.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: tags = new HashSet<String>()
focal_class.modifier: @NotNull
      private
focal_class.original_string: @NotNull
      private Set<String> tags = new HashSet<String>();
focal_class.type: Set<String>
focal_class.var_name: tags
focal_class.declarator: filteringStrategy
focal_class.modifier: @NotNull
      private final
focal_class.original_string: @NotNull
      private final FilteringStrategy filteringStrategy;
focal_class.type: FilteringStrategy
focal_class.var_name: filteringStrategy
focal_class.file: fluxtream-core/src/main/java/org/fluxtream/core/domain/TagFilter.java
focal_class.identifier: TagFilter
focal_class.class_method_signature: TagFilter.create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_class.full_signature: @Nullable public static TagFilter create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_class.identifier: create
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_class.return: TagFilter
focal_class.signature: TagFilter create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_class.class_method_signature: TagFilter.TagFilter(@Nullable final Collection<String> tags, @NotNull final FilteringStrategy filteringStrategy)
focal_class.full_signature: private  TagFilter(@Nullable final Collection<String> tags, @NotNull final FilteringStrategy filteringStrategy)
focal_class.identifier: TagFilter
focal_class.modifiers: private
focal_class.parameters: (@Nullable final Collection<String> tags, @NotNull final FilteringStrategy filteringStrategy)
focal_class.signature:  TagFilter(@Nullable final Collection<String> tags, @NotNull final FilteringStrategy filteringStrategy)
focal_class.class_method_signature: TagFilter.getTags()
focal_class.full_signature: @NotNull public Set<String> getTags()
focal_class.identifier: getTags
focal_class.modifiers: @NotNull public
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getTags()
focal_class.class_method_signature: TagFilter.getFilteringStrategy()
focal_class.full_signature: @NotNull public FilteringStrategy getFilteringStrategy()
focal_class.identifier: getFilteringStrategy
focal_class.modifiers: @NotNull public
focal_class.parameters: ()
focal_class.return: FilteringStrategy
focal_class.signature: FilteringStrategy getFilteringStrategy()
focal_class.class_method_signature: TagFilter.getWhereClause()
focal_class.full_signature: @NotNull public String getWhereClause()
focal_class.identifier: getWhereClause
focal_class.modifiers: @NotNull public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getWhereClause()
focal_class.class_method_signature: TagFilter.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: @Nullable
      public static TagFilter create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy) {
          // make sure the filtering strategy is non-null, choosing the default if necessary
          final FilteringStrategy filteringStrategy = requestedFilteringStrategy == null ? FilteringStrategy.getDefault() : requestedFilteringStrategy;
  
          if (FilteringStrategy.UNTAGGED.equals(filteringStrategy)) {
              // filter for untagged items
              return new TagFilter(null, FilteringStrategy.UNTAGGED);
          }
          else {
              if (tags != null) {
                  final Set<String> cleansedTags = new HashSet<String>();
                  for (final String tag : tags) {
                      final String cleansedTag = Tag.cleanse(tag);
                      if (cleansedTag.length() > 0) {
                          cleansedTags.add(cleansedTag);
                      }
                  }
                  if (!cleansedTags.isEmpty()) {
                      return new TagFilter(cleansedTags, filteringStrategy);
                  }
              }
          }
          return null;
      }
focal_method.class_method_signature: TagFilter.create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_method.full_signature: @Nullable public static TagFilter create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_method.identifier: create
focal_method.invocations: getDefault equals cleanse length add isEmpty
focal_method.modifiers: @Nullable public static
focal_method.parameters: (@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)
focal_method.return: TagFilter
focal_method.signature: TagFilter create(@Nullable final Collection<String> tags,
                                     @Nullable final FilteringStrategy requestedFilteringStrategy)