### Question:
DownloadMediaOptions { @Override public String toString() { StringBuilder builder = new StringBuilder(); boolean firstTime = true; for (String key : mParams.keySet()) { builder.append(firstTime ? "?" : "&"); if (firstTime) firstTime = false; String value = mParams.get(key); builder.append(key).append("=").append(value); } return builder.toString(); } private  DownloadMediaOptions(HashMap<String, String> params); @Override String toString();  }### Answer:
@Test public void testFullParams() { DownloadMediaOptions.Builder builder = new DownloadMediaOptions.Builder(); builder.allowStretch(true) .backgroundColor("black") .database("web") .disableMediaCaching(true) .height(100) .width(100) .language("en") .maxHeight(100) .maxWidth(100) .scale(0.3f) .thumbnail(true); assertNotNull(builder.build()); String finalURL = builder.build().toString(); assertEquals("?w=100&thn=1&db=web&dmc=1&la=en&as=1&mh=100&sc=0.3&mw=100&bc=black&h=100", finalURL); }
@Test public void testEmptyParams() { DownloadMediaOptions.Builder builder = new DownloadMediaOptions.Builder(); assertNotNull(builder.build()); String finalURL = builder.build().toString(); assertEquals("", finalURL); }
@Test public void testNotModifiableParams() { DownloadMediaOptions.Builder builder = new DownloadMediaOptions.Builder(); builder.maxHeight(100) .maxHeight(200) .maxHeight(300) .maxHeight(400); assertNotNull(builder.build()); String finalURL = builder.build().toString(); assertTrue(finalURL.contains("mh")); assertEquals(2, finalURL.split("mh").length); }