InstanceCoordinate { CloudnamePath toCloudnamePath() { return new CloudnamePath( new String[] {this.region, this.tag, this.service, this.instance}); } InstanceCoordinate(final CloudnamePath path); String getRegion(); String getTag(); String getService(); String getInstance(); String toCanonicalString(); static InstanceCoordinate parse(final String string); @Override String toString();  }
@Test public void testPathConversion() { final CloudnamePath path = new CloudnamePath( new String[] {"test", "local", "service", "instance" }); final InstanceCoordinate coordinate = new InstanceCoordinate(path); final CloudnamePath cnPath = coordinate.toCloudnamePath(); assertThat(cnPath.length(), is(path.length())); assertThat(cnPath, is(equalTo(path))); }