code: public StateEpisode setStateEpisode(StateEpisode stateEpisode)
      {
          this.stateEpisodeLock.writeLock().lock();
      	StateEpisode lastEpisode = this.stateEpisode;
          this.stateEpisode = stateEpisode;
          this.stateEpisodeLock.writeLock().unlock();
          return lastEpisode;
      }
docs: Set our state to a new episode.<br>
  This waits on the stateEpisodeLock to prevent the episode being changed whilst in use.
  @param stateEpisode the episode to switch to.
  @return the previous state episode.