ImmutableAuthorizationContextType extends AuthorizationContextType { static ImmutableAuthorizationContextType of(final CharSequence type) { return new ImmutableAuthorizationContextType(checkNotNull(type, "type").toString()); } private  ImmutableAuthorizationContextType(final String type);   }
@Test public void toStringReturnsExpected() { final ImmutableAuthorizationContextType underTest = ImmutableAuthorizationContextType.of(KNOWN_TYPE_VALUE); assertThat(underTest.toString()).isEqualTo(KNOWN_TYPE_VALUE); }
@Test public void lengthReturnsExpected() { final ImmutableAuthorizationContextType underTest = ImmutableAuthorizationContextType.of(KNOWN_TYPE_VALUE); assertThat(underTest.length()).isEqualTo(KNOWN_TYPE_VALUE.length()); }
@Test public void charAtReturnsExpected() { final byte charIndex = 3; final ImmutableAuthorizationContextType underTest = ImmutableAuthorizationContextType.of(KNOWN_TYPE_VALUE); assertThat(underTest.charAt(charIndex)).isEqualTo(KNOWN_TYPE_VALUE.charAt(charIndex)); }
@Test public void subSequenceReturnsExpected() { final byte sequenceStart = 5; final byte sequenceEnd = 11; final ImmutableAuthorizationContextType underTest = ImmutableAuthorizationContextType.of(KNOWN_TYPE_VALUE); assertThat(underTest.subSequence(sequenceStart, sequenceEnd)) .isEqualTo(KNOWN_TYPE_VALUE.subSequence(sequenceStart, sequenceEnd)); }
@Test public void compareToWorksAsExpected() { final ImmutableAuthorizationContextType authCtxTypeAbc = ImmutableAuthorizationContextType.of("abc"); final ImmutableAuthorizationContextType authCtxTypeDef = ImmutableAuthorizationContextType.of("def"); try (final AutoCloseableSoftAssertions softly = new AutoCloseableSoftAssertions()) { softly.assertThat(authCtxTypeAbc.compareTo(authCtxTypeAbc)) .as("compare with equal") .isZero(); softly.assertThat(authCtxTypeAbc.compareTo(authCtxTypeDef)) .as("compare with greater") .isNegative(); softly.assertThat(authCtxTypeDef.compareTo(authCtxTypeAbc)) .as("compare with less") .isPositive(); } }