PCollection<String> words = split(shakespeare, "\\s+");
PTable<String,Long> wordCounts = words.count();
PCollection<KeyValue> wordCountKeyValues = convertToKeyValues(wordCounts);
pipeline.write(wordCountKeyValues, ToHBase.hfile(outputPath));
PipelineResult result = pipeline.run();
assertTrue(result.succeeded());
FileSystem fs = FileSystem.get(conf);
KeyValue kv = readFromHFiles(fs, outputPath, "and");
assertEquals(427L, Bytes.toLong(kv.getValue()));
}