MimeTypeAggregator { public String getType() { if (isNotInitialized()) { throw new IllegalStateException("Add at least one MIME type"); } return topLevelType + DELIMITER + subType; }  String getType(); void add(String type);  }
@Test(expected = IllegalStateException.class) public void getTypeShouldThrowExceptionWhenNoMimeTypeWasAdded() { new MimeTypeAggregator().getType(); }