@Test
public void failsDecodeUncompletedString() {

    String wrongEncoded = "%D0%9F%3F%D1%80%23%D0%B8%20%D0%B2%D1%96%D1%8";
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(String.format("Malformed string '%s' at index %d", wrongEncoded, 42));
    decode(wrongEncoded, HOST);
}