ResourceIdentifier { public static ResourceIdentifier fromString(final String resource) { Objects.requireNonNull(resource); if (resource.isEmpty()) { throw new IllegalArgumentException("resource must not be empty"); } return new ResourceIdentifier(resource); } private  ResourceIdentifier(final String resource); private  ResourceIdentifier(final String endpoint, final String tenantId, final String resourceId); private  ResourceIdentifier(final ResourceIdentifier resourceIdentifier, final String tenantId, final String resourceId); private  ResourceIdentifier(final String[] path); String[] toPath(); String elementAt(final int index); int length(); static ResourceIdentifier fromString(final String resource); static ResourceIdentifier from(final String endpoint, final String tenantId, final String resourceId); static ResourceIdentifier from(final ResourceIdentifier resourceIdentifier, final String tenantId, final String resourceId); static ResourceIdentifier fromPath(final String[] path); String getEndpoint(); String getTenantId(); String getResourceId(); String[] getResourcePath(); @Override String toString(); String getBasePath(); String getPathWithoutBase(); boolean hasEventEndpoint(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test public void testFromStringFailsForEmptyString() { assertThatThrownBy(() -> ResourceIdentifier.fromString("")) .isInstanceOf(IllegalArgumentException.class); }