StreamSource extends AbstractSource<InputStream> { public static StreamSource newInstance(InputStream stream, String name) { if (stream == null) { throw new IllegalArgumentException("A not null stream instance and a not blank name are expected."); } return new StreamSource(stream, name); } private  StreamSource(InputStream stream, String name); @Override InputStream getSource(); @Override R dispatch(SourceDispatcher<R> dispatcher); @Override SeekableSource initializeSeekableSource(); static StreamSource newInstance(InputStream stream, String name);  }
@Test(expected = IllegalArgumentException.class) public void testNullStream() { StreamSource.newInstance(null, "fdsfs"); }
@Test(expected = IllegalArgumentException.class) public void testNullName() { InputStream stream = mock(InputStream.class); StreamSource.newInstance(stream, null); }