"for(var i in m) {if(m[i] != '') {var o = {};o[m[i]] = 1;r.push(o);}}return r;}" +
"\"}},{\"reduce\":{\"language\":\"javascript\",\"source\":\"" +
"function(v) {var r = {};for(var i in v) {for(var w in v[i]) {if(w in r) r[w] += v[i][w];" +
"else r[w] = v[i][w];}}return [r];}\"}}]}";
MapReduceOperation mrOp =
new MapReduceOperation.Builder(BinaryValue.unsafeCreate(query.getBytes()))
.build();
cluster.execute(mrOp);
mrOp.await();
assertTrue(mrOp.isSuccess());
ArrayNode resultList = mrOp.get().getResults().get(1);
// The query should return one result which is a JSON array containing a
// single JSON object that is a asSet of word counts.
assertEquals(resultList.size(), 1);