SystemInfo { public Zone zone() { return zone; } SystemInfo(Zone zone); Zone zone();  }
@Test public void testZone() { Zone zone = Zone.from("dev.us-west-1"); zone = Zone.from(zone.toString()); assertEquals(Environment.dev, zone.environment()); assertEquals("us-west-1", zone.region()); Zone sameZone = Zone.from("dev.us-west-1"); assertEquals(sameZone.hashCode(), zone.hashCode()); assertEquals(sameZone, zone); try { Zone.from("invalid"); fail("Expected exception"); } catch (IllegalArgumentException e) { assertEquals("A zone string must be on the form [environment].[region], but was 'invalid'", e.getMessage()); } try { Zone.from("invalid.us-west-1"); fail("Expected exception"); } catch (IllegalArgumentException e) { assertEquals("Invalid zone 'invalid.us-west-1': No environment named 'invalid'", e.getMessage()); } }