### Question:
FormatterConfig { public FormatterConfig setShownLength(int shownLength) { checkArgument(shownLength >= 0, "Shown length cannot be negative"); this.shownLength = shownLength; return this; } FormatterConfig();  FormatterConfig(FormatterConfig other); boolean willPrintTimestamps(); FormatterConfig setPrintTimestamps(boolean printTimestamps); int getShownLength(); boolean willLimitShowLength(); FormatterConfig setShownLength(int shownLength); FormatterConfig doNotLimitShowLength(); Supplier<DateFormat> getDateFormatSupplier(); FormatterConfig setDateFormatSupplier(Supplier<DateFormat> dateFormatSupplier);  }### Answer:
@Test public void testSetShownLength() { FormatterConfig config = new FormatterConfig(); try { config.setShownLength(-1); fail("Should throw on negative length."); } catch (IllegalArgumentException e) {} config.setShownLength(0); assertEquals(0, config.getShownLength()); assertTrue(config.willLimitShowLength()); config.setShownLength(1); assertEquals(1, config.getShownLength()); assertTrue(config.willLimitShowLength()); }