Added junit tests