### Question:
UpdateIndexOp extends AbstractGeoGigOp<Index> { public UpdateIndexOp setTreeRefSpec(String treeRefSpec) { this.treeRefSpec = treeRefSpec; return this; }  UpdateIndexOp setTreeRefSpec(String treeRefSpec); UpdateIndexOp setAttributeName(String attributeName); UpdateIndexOp setExtraAttributes(List<String> extraAttributes); UpdateIndexOp setOverwrite(boolean overwrite); UpdateIndexOp setAdd(boolean add); UpdateIndexOp setIndexHistory(boolean indexHistory); UpdateIndexOp setBounds(Envelope bounds);  }### Answer:
@Test public void testUpdateIndexDoNothing() { createIndex("x"); Exception e = assertThrows(IllegalArgumentException.class, repo.command(UpdateIndexOp.class) .setTreeRefSpec(worldPointsLayer.getName()) ::call); assertThat(e.getMessage(), containsString("Nothing to update...")); }
@Test public void testUpdateMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); Exception e = assertThrows(IllegalArgumentException.class, repo.command(UpdateIndexOp.class) .setTreeRefSpec(worldPointsLayer.getName()) ::call); assertThat(e.getMessage(), containsString( "Multiple indexes were found for the specified tree, please specify the attribute.")); }
@Test public void testUpdateIndexWrongTreeName() { Exception e = assertThrows(IllegalArgumentException.class, repo.command(UpdateIndexOp.class) .setTreeRefSpec("nonexistent") ::call); assertThat(e.getMessage(), containsString("Can't find feature tree 'nonexistent'")); }