}
@Test
public void fetchAnnotatedPojoWIthIndexes() throws ExecutionException, InterruptedException
{
RiakClient client = new RiakClient(cluster);
Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
Location loc = new Location(ns,"test_fetch_key6");
String jsonValue = "{\"value\":\"my value\"}";
RiakObject ro = new RiakObject()
.setValue(BinaryValue.create(jsonValue))
.setContentType("application/json");
ro.getIndexes().getIndex(StringBinIndex.named("email")).add("roach@basho.com");
ro.getIndexes().getIndex(LongIntIndex.named("user_id")).add(1L);
StoreValue sv = new StoreValue.Builder(ro).withLocation(loc).build();
client.execute(sv);
FetchValue fv = new FetchValue.Builder(loc).build();
FetchValue.Response resp = client.execute(fv);
RiakAnnotatedPojo rap = resp.getValue(RiakAnnotatedPojo.class);
assertNotNull(rap.emailIndx);
assertTrue(rap.emailIndx.contains("roach@basho.com"));