### Question:
FileObservable { public static Observable<String> lines(final Path path) { return Observable.create(new OnSubscribe<String>() { @Override public void call(Subscriber<? super String> s) { try (BufferedReader in = fileReader(path)) { String line; while ((line = in.readLine()) != null) { if (s.isUnsubscribed()) return; s.onNext(line); } s.onCompleted(); } catch (Exception e) { if (!s.isUnsubscribed()) s.onError(e); } } }); } private  FileObservable(); static Observable<Path> fileTreeWalker(final Path root); static Observable<String> lines(final Path path); static Observable<String> unzipLines(final Path path); static Func1<Path, Observable<String>> lines();  }### Answer:
@Test public void testLines() throws IOException { Path testFile = tempFile("target/testing/lines-test"); List<String> lines = createTestFile(testFile, "line1", "line2", "line3", "", "line5" ); TestObserver<String> testObserver = new TestObserver<>(); Observable<String> contents = FileObservable.lines(testFile); contents.subscribe(testObserver); testObserver.assertReceivedOnNext(lines); testObserver.assertTerminalEvent(); }