public void shouldComposeObjectsReturnedFromHeterogeneousIndexes() {
// Given
HetroEntity1 entity1 = new HetroEntity1(randomNumeric(3), "aFirstName");
HetroEntity2 entity2 = new HetroEntity2(randomNumeric(4), "aLastName");
IndexQuery idxQuery1 = new IndexQueryBuilder().withIndexName(INDEX_1_NAME).withId(entity1.getId()).withObject(entity1).build();
IndexQuery idxQuery2 = new IndexQueryBuilder().withIndexName(INDEX_2_NAME).withId(entity2.getId()).withObject(entity2).build();
elasticsearchTemplate.bulkIndex(Arrays.asList(idxQuery1, idxQuery2));
elasticsearchTemplate.refresh(INDEX_1_NAME, true);
elasticsearchTemplate.refresh(INDEX_2_NAME, true);