ImmutableLogicalFilter implements LogicalSearchFilter { public static ImmutableLogicalFilter not(final SearchFilter filter) { checkNotNull(filter, "filter to be negated"); return new ImmutableLogicalFilter(Type.NOT, Collections.singleton(filter)); } private  ImmutableLogicalFilter(final Type theFilterType, final Collection<SearchFilter> theFilters); static ImmutableLogicalFilter not(final SearchFilter filter); static ImmutableLogicalFilter and(final SearchFilter filter1, final SearchFilter filter2,
            final SearchFilter... furtherFilters); static ImmutableLogicalFilter or(final SearchFilter filter1, final SearchFilter filter2,
            final SearchFilter... furtherFilters); @Override Type getType(); @Override Collection<SearchFilter> getFilters(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = NullPointerException.class) public void tryToCreateNotFilterWithNullFilter() { ImmutableLogicalFilter.not(null); }
@Test public void createNotFilter() { final ImmutableLogicalFilter searchFilter = ImmutableLogicalFilter.not(searchFilterMock); assertThat(searchFilter) .hasType(SearchFilter.Type.NOT) .containsOnlyFilter(searchFilterMock); }