code: private boolean fileIncludesLine(File file, String matches) throws IOException {
          for (String line: Files.readLines(file)) {
              String trimmed = line.trim();
              if (trimmed.equals(matches)) {
                  return true;
              }
          }
          return false;
      }
docs: Checks whether the file contains specific line. Partial matches do not count.