@Test(expected = IndexExistsException.class)
public void createIndex_twice_throwsException() throws Exception {

    try {
        indexEngine.createIndex(TestModel.class);
    } catch (IndexExistsException e) {
        fail("IndexExistsException caught on wrong call");
    }
    indexEngine.createIndex(TestModel.class);
}