code: private static boolean expect(BufferedReader in, String key) throws IOException {
          String s = in.readLine();
          if (s != null && s.equals(key)) {
              return true;
          }
          return false;
      }
docs: Expect this key on the next line read from the reader.