public static ModeScope changeMode(Mode mode){
  Mode previousMode=tl.get();
  tl.set(mode);
  return new ModeScope(previousMode);
}

public static ModeScope changeMode ( Mode mode ) { Mode previousMode = tl . get ( ) ; tl . set ( mode ) ; return new ModeScope ( previousMode ) ; }
updates the mode for the current thread .
