@Test public void listCitizenZones() throws Exception { ZoneInfo about = service.createDefault("about", "about-alias"); ZoneInfo abc = service.createDefault("abc", "abc-alias"); service.createKaif("kaif-java", "java-alias"); ZoneInfo groovy = service.createDefault("groovy", "groovy-alias"); assertEquals(asList(abc, about, groovy), service.listCitizenZones()); }
@Override public List<ZoneInfo> listCitizenZones() { return zoneDao.listOrderByName() .stream() .filter(zoneInfo -> zoneInfo.getWriteAuthority() == Authority.CITIZEN) .collect(toList()); }
ZoneServiceImpl implements ZoneService { @Override public List<ZoneInfo> listCitizenZones() { return zoneDao.listOrderByName() .stream() .filter(zoneInfo -> zoneInfo.getWriteAuthority() == Authority.CITIZEN) .collect(toList()); } }
ZoneServiceImpl implements ZoneService { @Override public List<ZoneInfo> listCitizenZones() { return zoneDao.listOrderByName() .stream() .filter(zoneInfo -> zoneInfo.getWriteAuthority() == Authority.CITIZEN) .collect(toList()); }  }
ZoneServiceImpl implements ZoneService { @Override public List<ZoneInfo> listCitizenZones() { return zoneDao.listOrderByName() .stream() .filter(zoneInfo -> zoneInfo.getWriteAuthority() == Authority.CITIZEN) .collect(toList()); }  @Override ZoneInfo loadZone(Zone zone); @Override ZoneInfo createDefault(String zone, String aliasName); @Override ZoneInfo createKaif(String zone, String aliasName); @Override void updateTheme(Zone zone, String theme); @Override Map<String, List<ZoneInfo>> listZoneAtoZ(); @Override List<ZoneInfo> listRecommendZones(); @Override List<ZoneInfo> listCitizenZones(); @Override ZoneInfo createByUser(String zone, String aliasName, Authorization creator); @Override List<ZoneInfo> listAdministerZones(String username); @Override boolean isZoneAvailable(String zone); @Override boolean canCreateZone(Authorization authorization); @Override List<String> listAdministratorsWithCache(Zone zone); }
ZoneServiceImpl implements ZoneService { @Override public List<ZoneInfo> listCitizenZones() { return zoneDao.listOrderByName() .stream() .filter(zoneInfo -> zoneInfo.getWriteAuthority() == Authority.CITIZEN) .collect(toList()); }  @Override ZoneInfo loadZone(Zone zone); @Override ZoneInfo createDefault(String zone, String aliasName); @Override ZoneInfo createKaif(String zone, String aliasName); @Override void updateTheme(Zone zone, String theme); @Override Map<String, List<ZoneInfo>> listZoneAtoZ(); @Override List<ZoneInfo> listRecommendZones(); @Override List<ZoneInfo> listCitizenZones(); @Override ZoneInfo createByUser(String zone, String aliasName, Authorization creator); @Override List<ZoneInfo> listAdministerZones(String username); @Override boolean isZoneAvailable(String zone); @Override boolean canCreateZone(Authorization authorization); @Override List<String> listAdministratorsWithCache(Zone zone);  }