SearchPermissionCheckerImpl implements SearchPermissionChecker { @Override public BooleanFilter getPermissionBooleanFilter( long companyId, long[] groupIds, long userId, String className, BooleanFilter booleanFilter, SearchContext searchContext) { try { return _getPermissionBooleanFilter( companyId, groupIds, userId, className, booleanFilter, searchContext); } catch (Exception exception) { _log.error(exception, exception); return booleanFilter; } }  @Override void addPermissionFields(long companyId, Document document); @Override BooleanFilter getPermissionBooleanFilter(
		long companyId, long[] groupIds, long userId, String className,
		BooleanFilter booleanFilter, SearchContext searchContext); @Override void updatePermissionFields(
		String resourceName, String resourceClassPK);  }
@Test public void testNullInput() { Assert.assertNull( _searchPermissionChecker.getPermissionBooleanFilter( 0, null, 0, null, null, null)); }
@Test public void testPermissionFilterTakesOverNullInputFilter() throws Exception { long userId = RandomTestUtil.randomLong(); whenIndexerIsPermissionAware(true); whenPermissionCheckerGetUser(_user); whenPermissionCheckerGetUserBag(_userBag); whenUserGetUserId(userId); BooleanFilter booleanFilter = null; BooleanFilter permissionBooleanFilter = _searchPermissionChecker.getPermissionBooleanFilter( 0, null, userId, null, booleanFilter, new SearchContext()); Assert.assertNotNull(permissionBooleanFilter); }