@Test(expected = IllegalStateException.class) public void testAddCannotBeCalledAfterBuild() throws Exception { NamedListBuilder<String> builder = new NamedListBuilder<>(); builder.build(); builder.add("foo", "bar"); }
@Test(expected = IllegalStateException.class) public void testBuildCannotBeCalledMoreThanOnce() throws Exception { NamedListBuilder<String> builder = new NamedListBuilder<>(); builder.build(); builder.build(); }