code: private GuacamoleInstruction expect(GuacamoleReader reader, String opcode)
          throws GuacamoleException {
  
          // Wait for an instruction
          GuacamoleInstruction instruction = reader.readInstruction();
          if (instruction == null)
              throw new GuacamoleServerException("End of stream while waiting for \"" + opcode + "\".");
  
          // Ensure instruction has expected opcode
          if (!instruction.getOpcode().equals(opcode))
              throw new GuacamoleServerException("Expected \"" + opcode + "\" instruction but instead received \"" + instruction.getOpcode() + "\".");
  
          return instruction;
  
      }
docs: Waits for the instruction having the given opcode, returning that
  instruction once it has been read. If the instruction is never read,
  an exception is thrown.
  
  @param reader The reader to read instructions from.
  @param opcode The opcode of the instruction we are expecting.
  @return The instruction having the given opcode.
  @throws GuacamoleException If an error occurs while reading, or if
  the expected instruction is not read.