### Question:
GenericDataSource implements DataSource { @Override public InputStream getInputStream() { if (logger.isInfoEnabled()) logger.info("returning static input stream " + getResourceName()); return inputStream; } GenericDataSource(InputStream inputStream, String resourceName); @Override URI getUri(); @Override String getResourceName(); @Override InputStream getInputStream();  }### Answer:
@Test public void testGetInputStream() { InputStream inputStream = createMock(InputStream.class); GenericDataSource staticDataSource = new GenericDataSource(inputStream, "resource"); assertThat(staticDataSource.getInputStream(), IsSame.sameInstance(inputStream)); }