### Question:
Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); }    }### Answer:
@Test public void shouldExplodeWhenContainsIllegalCharacters() { assertThatThrownBy(() -> Url62.decode("Foo Bar")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("contains illegal characters"); }
@Test public void shouldFaildOnEmptyString() { assertThatThrownBy(() -> Url62.decode("")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("must not be empty"); }
@Test public void shouldFailsOnNullString() { assertThatThrownBy(() -> Url62.decode(null)) .isInstanceOf(NullPointerException.class) .hasMessageContaining("must not be null"); }
@Test public void shouldFailsWhenStringContainsMoreThan128bitInformation() { assertThatThrownBy(() -> Url62.decode("7NLCAyd6sKR7kDHxgAWFPas")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("contains more than 128bit information"); }