}
pojo.rawInt = pojo.rawInts.iterator().next();
pojo.rawBin = pojo.rawBins.iterator().next();
RiakIndexes rIndexes = new RiakIndexes();
AnnotationUtil.getIndexes(rIndexes, pojo);
assertEquals("Expected RiakIndexes BinIndex (favorite_languages) to be populated",
rIndexes.getIndex(StringBinIndex.named("favorite_languages")).size(),
pojo.languages.size());
assertEquals("Expected RiakIndexes BinIndex (lucky_language) to be populated",
rIndexes.getIndex(StringBinIndex.named("lucky_language")).size(),
1);
assertEquals("Expected RiakIndexes BinIndex (set_raw) to be pupulated",
rIndexes.getIndex(RawIndex.named("set_raw", IndexType.BIN)).size(),
pojo.rawBins.size());
assertEquals("Expected RiakIndexes BinIndex (raw) to be pupulated",
rIndexes.getIndex(RawIndex.named("raw", IndexType.BIN)).size(),
1);
assertEquals("Expected RiakIndexes IntIndex (longs) to be populated",
rIndexes.getIndex(LongIntIndex.named("longs")).size(),
pojo.longs.size());
assertEquals("Expected RiakIndexes IntIndex (lucky_long) to be populated",
rIndexes.getIndex(LongIntIndex.named("lucky_long")).size(),
1);
assertEquals("Expected RiakIndexes IntIndex (lucky_longlong) to be populated",
rIndexes.getIndex(LongIntIndex.named("lucky_longlong")).size(),
1);
assertEquals("Expected RiakIndexes IntIndex (set_raw) to be pupulated",
rIndexes.getIndex(RawIndex.named("set_raw", IndexType.INT)).size(),
pojo.rawInts.size());
assertEquals("Expected RiakIndexes IntIndex (raw) to be pupulated",
rIndexes.getIndex(RawIndex.named("raw", IndexType.INT)).size(),
1);
assertTrue(rIndexes.getIndex(StringBinIndex.named("favorite_languages")).values().containsAll(pojo.languages));
assertEquals(rIndexes.getIndex(StringBinIndex.named("lucky_language")).iterator().next(),
pojo.languages.iterator().next());
assertTrue(rIndexes.getIndex(LongIntIndex.named("longs")).values().containsAll(pojo.longs));
assertEquals(rIndexes.getIndex(LongIntIndex.named("lucky_long")).iterator().next(),
pojo.longs.iterator().next());
assertEquals(rIndexes.getIndex(LongIntIndex.named("lucky_longlong")).iterator().next(),
pojo.longs.iterator().next());
assertArrayEquals(rIndexes.getIndex(RawIndex.named("raw", IndexType.INT)).iterator().next().getValue(),
pojo.rawInt);
}