code: private <T extends IGPSObject> T syncCommand(final String command, final Class<T> responseClass) throws IOException {
  		synchronized (this.asyncMutex) {
  			if (out != null) {
  				this.out.write(command + "\n");
  				this.out.flush();
  			}
  			if (responseClass == WatchObject.class) {
  				lastWatch = command;
  			}
  			while (true) {
  				// wait for awaited message
  				// FIXME possible infinite loop if expected result arrives but new result overrides expected result before getting to this point.
  				final IGPSObject result = this.waitForResult();
  				if ((result == null) || result.getClass().equals(responseClass)) {
  					return responseClass.cast(result);
  				}
  			}
  		}
  	}
docs: /*
  send command to GPSd and wait for response