KeyIterator implements Iterable<K> { @Override public Iterator<K> iterator() { return keyIterator; } @Deprecated  KeyIterator(Keyspace keyspace, String columnFamily, Serializer<K> serializer); @Deprecated  KeyIterator(Keyspace keyspace, String columnFamily, Serializer<K> serializer, int maxRowCount); @Deprecated  KeyIterator(Keyspace keyspace, String columnFamily, Serializer<K> serializer, K start, K end); @Deprecated /* * When pulling deprecated methods out, do not remove this but change it to private constructor */  KeyIterator(Keyspace keyspace, String columnFamily, Serializer<K> serializer, K start, K end, int maxRowCount); protected  KeyIterator(Builder<K> builder); @Override Iterator<K> iterator();  }
@Test public void testIterator() { Mutator<String> m = createMutator(keyspace, se); for (int i = 1; i <= 9; i++) { m.addInsertion("k" + i, CF, createColumn(new Integer(i), new Integer(i), is, is)); } m.execute(); assertKeys(5, "k5", null); assertKeys(9, null, null); assertKeys(7, null, "k7"); assertStringKeys(5, "k5", null); assertStringKeys(9, null, null); assertStringKeys(7, null, "k7"); assertKeys(5, "k5", 1); assertKeys(9, null, 2); assertKeys(9, null, 5); assertKeys(8, "k2", 7); assertKeys(7, "k3", 10); }