Environment { public boolean isDifferentRegions() { if (getNumberRegions() > 1) { return true; } return false; } Environment();  Environment(String name, Set<Tier> tiers);  Environment(String name, Set<Tier> tiers, String description, String org, String vdc);  Environment(String name, String description, Set<Tier> tiers); void addTier(Tier tier); void deleteTier(Tier tier); void updateTier(Tier tierOld, Tier tierNew); @Override boolean equals(Object obj); String getDescription(); Long getId(); String getName(); String getOrg(); String getOvf(); Set<Tier> getTiers(); String getVdc(); @Override int hashCode(); void setDescription(String description); void setId(Long id); void setName(String name); void setOrg(String org); void setOvf(String ovf); void setTiers(Set<Tier> tiers); void setVdc(String vdc); EnvironmentDto toDto(); Map<String, Set<String>> getNetworksRegion(); Set<String> getFederatedNetworks(); boolean isDifferentRegions(); boolean isNetworkFederated(); Network getNetworkWithRegionAndName(String region, String networkName); String toString(); static final String ORG_FIELD; static final String VDC_FIELD; static final String ENVIRONMENT_NAME_FIELD; static final int COLUMN_LENGHT; static final int LONG_COLUMN_LENGHT; }
@Test public void testIsDifferentRegions() { Tier tier = new Tier("name1", new Integer(1), new Integer(5), new Integer(1), null); tier.setRegion("region1"); Tier tier2 = new Tier("name2", new Integer(1), new Integer(5), new Integer(1), null); tier.setRegion("region2"); Set<Tier> tiers = new HashSet<Tier>(); tiers.add(tier); tiers.add(tier2); Environment env = new Environment(); env.setName("environmentName"); env.addTier(tier); env.addTier(tier2); boolean result = env.isDifferentRegions(); assertEquals(result, true); }