ImmutableLogicalFilter implements LogicalSearchFilter { public static ImmutableLogicalFilter or(final SearchFilter filter1, final SearchFilter filter2, final SearchFilter... furtherFilters) { checkNotNull(filter1, "first filter to be concatenated with OR"); checkNotNull(filter2, "second filter to be concatenated with OR"); checkNotNull(furtherFilters, "further searchFilters to be concatenated with OR"); return new ImmutableLogicalFilter(Type.OR, paramsToList(filter1, filter2, furtherFilters)); } 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 tryToCreateOrFilterWithNullFirstFilter() { ImmutableLogicalFilter.or(null, searchFilterMock); }
@Test(expected = NullPointerException.class) public void tryToCreateOrFilterWithNullSecondFilter() { ImmutableLogicalFilter.or(searchFilterMock, null); }
@Test(expected = NullPointerException.class) public void tryToCreateOrFilterWithNullAdditionalFilters() { ImmutableLogicalFilter.or(searchFilterMock, searchFilterMock, null); }
@Test public void createOrFilter() { final ImmutableLogicalFilter underTest = ImmutableLogicalFilter.or(searchFilterMock, searchFilterMock, searchFilterMock, searchFilterMock); assertThat(underTest) .hasType(SearchFilter.Type.OR) .containsAmountOfFilters(4) .containsOnlyFilter(searchFilterMock); }