Added dock and undock methods and corrosponding tests