Josephson effect between trapped Bose-Einstein condensates