code: @SuppressWarnings("unchecked")
      public <T> T set(T newUserObject) {
          T result = (T)userObject;
          userObject = newUserObject;
          return result;
      }
docs: Replace the associated user object with a new object.
  @param <T> the object type
  @param newUserObject the new user object
  @return the original user object