FacilityFacadeEjb implements FacilityFacade { @Override public List<FacilityReferenceDto> getAllActiveLaboratories(boolean includeOtherFacility) { List<Facility> laboratories = facilityService.getAllActiveLaboratories(includeOtherFacility); return laboratories.stream().map(l -> toReferenceDto(l)).collect(Collectors.toList()); }  @Override List<FacilityReferenceDto> getActiveFacilitiesByCommunityAndType(
		CommunityReferenceDto communityRef,
		FacilityType type,
		boolean includeOtherFacility,
		boolean includeNoneFacility); @Override List<FacilityReferenceDto> getActiveFacilitiesByDistrictAndType(
		DistrictReferenceDto districtRef,
		FacilityType type,
		boolean includeOtherFacility,
		boolean includeNoneFacility); @Override List<FacilityReferenceDto> getActiveHospitalsByCommunity(CommunityReferenceDto communityRef, boolean includeOtherFacility); @Override List<FacilityReferenceDto> getActiveHospitalsByDistrict(DistrictReferenceDto districtRef, boolean includeOtherFacility); @Override List<FacilityReferenceDto> getAllActiveLaboratories(boolean includeOtherFacility); @Override List<String> getAllUuids(); @Override List<FacilityDto> getAllByRegionAfter(String regionUuid, Date date); @Override List<FacilityDto> getAllWithoutRegionAfter(Date date); @Override FacilityDto getByUuid(String uuid); @Override List<FacilityDto> getByUuids(List<String> uuids); @Override FacilityReferenceDto getFacilityReferenceByUuid(String uuid); @Override FacilityReferenceDto getFacilityReferenceById(long id); @Override Map<String, String> getDistrictUuidsForFacilities(List<FacilityReferenceDto> facilities); @Override Map<String, String> getCommunityUuidsForFacilities(List<FacilityReferenceDto> facilities); @Override List<FacilityReferenceDto> getByNameAndType(
		String name,
		DistrictReferenceDto districtRef,
		CommunityReferenceDto communityRef,
		FacilityType type,
		boolean includeArchivedEntities); @Override List<FacilityReferenceDto> getLaboratoriesByName(String name, boolean includeArchivedEntities); @Override void archive(String facilityUuid); @Override void dearchive(String facilityUuid); @Override boolean hasArchivedParentInfrastructure(Collection<String> facilityUuids); static FacilityReferenceDto toReferenceDto(Facility entity); @Override List<FacilityDto> getIndexList(FacilityCriteria facilityCriteria, Integer first, Integer max, List<SortProperty> sortProperties); @Override long count(FacilityCriteria criteria); @Override void saveFacility(FacilityDto dto);  }
@Test public void testGetAllActiveLaboratories() { RDCF rdcf = creator.createRDCF("r", "d", "c", "f"); FacilityDto f1 = getFacilityFacade().getByUuid(rdcf.facility.getUuid()); getFacilityFacade().archive(f1.getUuid()); f1 = getFacilityFacade().getByUuid(f1.getUuid()); f1.setType(FacilityType.LABORATORY); getFacilityFacade().saveFacility(f1); FacilityDto f2 = creator.createFacility("f2", rdcf.region, rdcf.district, rdcf.community); f2 = getFacilityFacade().getByUuid(f2.getUuid()); f2.setType(FacilityType.LABORATORY); getFacilityFacade().saveFacility(f2); assertEquals(1, getFacilityFacade().getAllActiveLaboratories(false).size()); }