### Question:
FireflyExtensionRepository { public FireflyExtensionModel create(String name) { Assert.hasText(name); FireflyExtensionModel result = new FireflyExtensionModel(); result.setName(name); result.setStates(new ArrayList<FireflyExtensionStateModel>()); return result; }  FireflyExtensionModel findByName(String name); FireflyExtensionModel create(String name); void save(FireflyExtensionModel model);  }### Answer:
@Test public void shouldCreate() throws Exception { String name = "new-extension"; FireflyExtensionModel result = fireflyExtensionRepository.create(name); assertNotNull(result); assertEquals(name, result.getName()); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowCreationWithoutName() throws Exception { fireflyExtensionRepository.create(null); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowCreationWithoutEmpty() throws Exception { fireflyExtensionRepository.create(""); }