> On 12 Sep 2016, at 10:15, Lance Andersen <lance.ander...@oracle.com> wrote: >> >> Suggestion: >> >> 70 try (BufferedReader reader = new BufferedReader(new >> CharArrayReader(cw.toCharArray()))) { >> 71 boolean result >> 72 = reader.lines().anyMatch( >> 73 line -> line.matches(".*JDBC DriverManager >> initialized.*")); >> 74 assertFalse(result); >> >> >> Change anyMatch, to noneMatch, and assertTrue (note if the stream is empty >> none is “vacuously” satisfied and will return true). > > Thank you Paul. I can make that change, was not sure (if one was faster than > the other) >
Both will short-circuiting when the predicate returns true, speed-wise it should not be an issue. Arguably, noneMatch better expresses the intent of that is being tested. Paul.