ApplicationId implements Comparable<ApplicationId> { public ApplicationId(ApplicationIdConfig config) { this(TenantName.from(config.tenant()), ApplicationName.from(config.application()), InstanceName.from(config.instance())); } 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 public void require_that_equals_and_hashcode_behaves_correctly() { new EqualsTester() .addEqualityGroup(idFrom("tenant1", "name1", "instance1"), idFrom("tenant1", "name1", "instance1")) .addEqualityGroup(idFrom("tenant2", "name1", "instance1")) .addEqualityGroup(idFrom("tenant1", "name2", "instance1")) .addEqualityGroup(idFrom("tenant1", "name1", "instance2")) .addEqualityGroup(applicationId("onlyName1")) .addEqualityGroup(applicationId("onlyName2")) .testEquals(); }