### Question:
LazyDataSource implements DataSource { public String getContentType() { load(); return dataSource.getContentType(); } LazyDataSource(String id, Collection<Attachment> attachments); String getContentType(); InputStream getInputStream(); String getName(); OutputStream getOutputStream(); DataSource getDataSource(); void setDataSource(DataSource dataSource);  }### Answer:
@Test public void testNoDataSource() throws Exception { DataSource ds = new LazyDataSource(ID_1, Collections.singleton(new AttachmentImpl(ID_1, new DataHandler((DataSource) null) { @Override public DataSource getDataSource() { return null; } }))); try { ds.getContentType(); fail(); } catch (IllegalStateException e) { String message = e.getMessage(); assertTrue(message, message.contains(ID_1)); } }