UrlParameterBuilder { public void addParameter(@Nonnull final String key, @Nonnull final Object value) { assert key != null; assert !key.isEmpty(); assert value != null; parameters.add(new Pair(key, value.toString())); }  void clear(); void addParameter(@Nonnull final String key, @Nonnull final Object value); @Nonnull @Override String toString(); @Nonnull static String encode(@Nonnull final String par); @Nonnull
    static final String ENCODING; }
@SuppressWarnings("ErrorNotRethrown") @Test public void testAttemptAddWithEmptyKey() { LOG.info("testAttemptAddWithEmptyKey"); final UrlParameterBuilder builder = new UrlParameterBuilder(); try { builder.addParameter("", "a value"); } catch (final AssertionError ignored) { return; } Assert.fail("Wrong: empty key accepted!"); }
@SuppressWarnings("ErrorNotRethrown") @Test public void testAttemptAddWithNullKey() { LOG.info("testAttemptAddWithNullKey"); final UrlParameterBuilder builder = new UrlParameterBuilder(); try { builder.addParameter(null, "a value"); } catch (final AssertionError | IllegalArgumentException ignored) { return; } Assert.fail("Wrong: null accepted by @Nonnull parameters!"); }