### Question:
FileSource implements Source { @Override public InputStream getInputStream() throws IOException { return new FileInputStream( file ); } FileSource( File file ); @Override InputStream getInputStream(); @Override String getLocation(); File getFile(); @Override String toString(); @Override int hashCode(); @Override boolean equals( Object obj );  }### Answer:
@Test public void testGetInputStream() throws Exception { File txtFile = new File( "target/test-classes/source.txt" ); FileSource source = new FileSource( txtFile ); try ( InputStream is = source.getInputStream(); Scanner scanner = new Scanner( is ) ) { assertEquals( "Hello World!", scanner.nextLine() ); } }