### Question:
StreamPatternMatches implements Closeable { public void close() throws IOException { if (input != null) { input.close(); input = null; } } StreamPatternMatches(Reader input, Collection<Pattern> patterns, boolean discard); Matcher next(); boolean hasNext(); void close();  }### Answer:
@Test public void testCLoseIsPropagated() throws Exception { Pattern pattern = Pattern.compile(".*"); StreamPatternMatches matches = new StreamPatternMatches(reader, asList(pattern), true); matches.close(); verify(reader).close(); }