ApplicationId implements Comparable<ApplicationId> { public static ApplicationId fromSerializedForm(String idString) { String[] parts = idString.split(":"); if (parts.length < 3) throw new IllegalArgumentException("Application ids must be on the form tenant:application:instance, but was " + idString); return new Builder().tenant(parts[0]).applicationName(parts[1]).instanceName(parts[2]).build(); } ApplicationId(ApplicationIdConfig config); private  ApplicationId(TenantName tenant, ApplicationName applicationName, InstanceName instanceName); static ApplicationId from(TenantName tenant, ApplicationName application, InstanceName instance); static ApplicationId from(String tenant, String application, String instance); static ApplicationId fromSerializedForm(String idString); static ApplicationId fromFullString(String idString); @Override int hashCode(); @Override boolean equals(Object other); String serializedForm(); String toShortString(); String toFullString(); @Override String toString(); TenantName tenant(); ApplicationName application(); InstanceName instance(); @Override int compareTo(ApplicationId other); static ApplicationId defaultId(); static ApplicationId global();  }
@Test(expected = IllegalArgumentException.class) public void require_that_invalid_idstring_throws_exception() { ApplicationId.fromSerializedForm("foo:baz"); }