ImmutableAuthorizationSubject implements AuthorizationSubject { public static ImmutableAuthorizationSubject of(final CharSequence id) { final String argumentName = "identifier of the new authorization subject"; checkNotNull(id, argumentName); checkNotEmpty(id, argumentName); return new ImmutableAuthorizationSubject(id); } private  ImmutableAuthorizationSubject(final CharSequence theId); static ImmutableAuthorizationSubject of(final CharSequence id); @Override String getId(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = NullPointerException.class) public void tryToCreateAuthorizationSubjectWithNullId() { ImmutableAuthorizationSubject.of(null); }
@Test(expected = IllegalArgumentException.class) public void tryToCreateAuthorizationSubjectWithEmptyId() { ImmutableAuthorizationSubject.of(""); }