 
      (fact
       "count-by-key returns a hashmap of (K, int) pairs with the count of each key; only available on RDDs of type (K, V)"
-      (-> (f/parallelize c [["key1" 1]
-                            ["key1" 2]
-                            ["key2" 3]
-                            ["key2" 4]
-                            ["key3" 5]])
-          (f/map-to-pair identity)
+      (-> (f/parallelize-pairs c [(ft/tuple "key1" 1)
+                                  (ft/tuple "key1" 2)
+                                  (ft/tuple "key2" 3)
+                                  (ft/tuple "key2" 4)
+                                  (ft/tuple "key3" 5)])
           (f/count-by-key)) => {"key1" 2 "key2" 2 "key3" 1})
 
      (fact


     (fact
      "left-outer-join returns an RDD of (K, (V, W)) when called on RDDs of type (K, V) and (K, W)"
      (let [LDATA (f/parallelize c [["key1" [2]]
                                    ["key2" [3]]
                                    ["key3" [5]]
                                    ["key4" [1]]
                                    ["key5" [2]]])
            RDATA (f/parallelize c [["key1" [22]]
                                    ["key3" [33]]
                                    ["key4" [44]]])]
        (-> (f/left-outer-join (f/map-to-pair LDATA identity) (f/map-to-pair RDATA identity))
            ;; how to unwrap a left-outer-join
            (f/map (f/fn [t]
                     (let [[x t2] (f/untuple t)


     (fact
      "values returns the values (V) of a hashmap of (K, V) pairs from a JavaPairRDD"
      (-> (f/parallelize-pairs c [(ft/tuple "key1" 11)
                                  (ft/tuple "key1" 11)
                                  (ft/tuple "key2" 12)
                                  (ft/tuple "key2" 12)
                                  (ft/tuple "key3" 13)])
          (f/values)
          (f/collect)
          vec) => [11 11 12 12 13])
