### Question:
DocumentConfiguration { public void registerIndexes(final Collection<IndexDefinition> indexDefinitions) { for (final IndexDefinition indexDefinition : indexDefinitions) { final String indexPropertyName = indexDefinition.getName(); if (!properties.containsKey(indexPropertyName)) { throw new IllegalStateException("Unable to register index for non-property: " + indexPropertyName); } this.indexDefinitions.add(indexDefinition); } } DocumentConfiguration(final Class<? extends Document> documentClass, final String namespace); void registerIndexes(final Collection<IndexDefinition> indexDefinitions); Class<? extends Document> documentClass(); String namespace(); Map<String, PropertyDescriptor> properties(); Collection<IndexDefinition> indexDefinitions();  }### Answer:
@Test public void shouldNotRegisterIndexes_withIncorrectIndexDefinitions() throws Exception { final Collection<IndexDefinition> indexDefinitions = Arrays.asList(new IndexDefinition(randomString(10), IndexFieldType.INT)); final String namespace = randomString(10); final Class<? extends Document> documentClass = StubDocument.class; final DocumentConfiguration documentConfiguration = new DocumentConfiguration(documentClass, namespace); IllegalStateException actualException = null; try { documentConfiguration.registerIndexes(indexDefinitions); } catch (final IllegalStateException e) { actualException = e; } assertNotNull(actualException); }