                               ["key2" 4]
                               ["key3" 5]])
             (f/count-by-key)) => {"key1" 2, "key2" 2, "key3" 1})
+
+      (fact
+        "foreach runs a function on each element of the RDD, returns nil; this is usually done for side effcts"
+        (-> (f/parallelize c [1 2 3 4 5])
+            (f/foreach (f/fn [x] x))) => nil)
+
+      (fact
+        "first returns the first element of an RDD"
+        (-> (f/parallelize c [1 2 3 4 5])
+            f/first) => 1)
+
+      (fact
+        "count return the number of elements in an RDD"
+        (-> (f/parallelize c [["a" 1] ["b" 2] ["c" 3] ["d" 4] ["e" 5]])
+            f/count) => 5)
+
+      (fact
+        "collect returns all elements of the RDD as an array at the driver program"
+        (-> (f/parallelize c [[1] [2] [3] [4] [5]])
+            f/collect) => [[1] [2] [3] [4] [5]])
+
+      (fact
+        "distinct"
+        (-> (f/parallelize c [1 2 1 3 4 5 4])
+            f/distinct
+            f/collect
+            vec) => (contains #{1 2 3 4 5}))
+
+      (fact
+        "take returns an array with the first n elements of an RDD"
+        (-> (f/parallelize c [1 2 3 4 5])
+            (f/take 3)) => [1 2 3])
+
+      (fact
+        "glom returns an RDD created by coalescing all elements within each partition into a list"
+        (-> (f/parallelize c [[1] [2] [3] [4] [5]])
+            f/glom
+            f/collect
+            vec) => [[[1]] [[2]] [[3]] [[4] [5]]])
+
+      (fact
+        "cache persists this RDD with a default storage level (MEMORY_ONLY)"
+        (let [cache (-> (f/parallelize c [1 2 3 4 5])
+                        (f/cache))]
+          (-> cache
+              f/collect) => [1 2 3 4 5]))
       )))

        (-> (f/parallelize c [1 2 3 4 5])
            (f/map (f/fn [x] (* 2 x)))
            f/collect
            vec) => [2 4 6 8 10])

      (fact
        "map-to-pair returns an RDD of (K, V) pairs formed by passing each element of the source

      (fact
        "similar to map, but each input item can be mapped to 0 or more output items;
        mapping function must therefore return a sequence rather than a single item"
        (-> (f/parallelize c [["Four score and seven years ago our fathers"]
                              ["brought forth on this continent a new nation"]])
            (f/flat-map (f/fn [x] (clojure.string/split (first x) #" ")))
            f/collect
            vec) => ["Four" "score" "and" "seven" "years" "ago" "our" "fathers" "brought" "forth" "on" "this" "continent" "a" "new" "nation"])

