### Question:
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getFilters(int filterId, String domain) throws ServiceException { List<Map<String, Object>> filters; try{ filters = repository .getFiltersFromDb(filterId); }catch(DataException e){ throw new ServiceException(e); } if (null != domain && !INFRA_AND_PLATFORMS.equalsIgnoreCase(domain)) filters.removeIf(f -> (f.get("optionName").equals( REGION_DISPALY_NAME) || f.get("optionName").equals( ACCOUNT_NAME))); if(filters.isEmpty()){ throw new ServiceException(NO_DATA_FOUND); } return filters; }  List<Map<String, Object>> getFilters(int filterId, String domain); List<Map<String, Object>> getPolicies(String assetGroup,
            String domain); List<Map<String, Object>> getRegions(String assetGroup); List<Map<String, Object>> getAccounts(String assetGroup); List<Map<String, Object>> getRules(String assetGroup, String domain); List<Map<String, Object>> getApplications(String assetGroup,
            String domain); List<Map<String, Object>> getEnvironmentsByAssetGroup(
            String assetGroup, String application, String domain); List<Map<String, Object>> getTargetTypesForAssetGroup(
            String assetGroup, String domain);  }### Answer:
@Test public void getFiltersTest() throws Exception { Map<String, Object> filterMap = new HashMap<>(); List<Map<String, Object>> filters = new ArrayList<>(); filterMap.put("optionName", "Policy"); filterMap.put("optionValue", "policyId.keyword"); filterMap.put("optionURL", "optionURL"); filters.add(filterMap); filterMap = new HashMap<>(); filterMap.put("optionName", "Region"); filterMap.put("optionValue", "region.keyword"); filterMap.put("optionURL", "optionURL"); filters.add(filterMap); filterMap = new HashMap<>(); filterMap.put("optionName", "accountname"); filterMap.put("optionValue", "accountid.keyword"); filterMap.put("optionURL", "optionURL"); filters.add(filterMap); when(repository.getFiltersFromDb(anyInt())) .thenReturn(filters); assertThat(filterServiceImpl.getFilters(1, "test"), is(notNullValue())); when(repository.getFiltersFromDb(anyInt())).thenThrow(new DataException()); assertThatThrownBy( () -> filterServiceImpl.getFilters(1,"qwe")).isInstanceOf(ServiceException.class); }