### Question:
IndexDefinition { public Class<?> propertyType() { if (propertyType == null) { throw new IllegalStateException("Key not registered with ItemConfiguration"); } return propertyType; } IndexDefinition(final String propertyName); String propertyName(); Class<?> propertyType(); void setPropertyType(final Class<?> propertyType); @Override int hashCode(); @Override boolean equals(final Object obj);  }### Answer:
@Test public void shouldNotReturnPropertyType_withNonInitializedIndexDefinition() throws Exception { final IndexDefinition indexDefinition = new IndexDefinition(randomString(10)); IllegalStateException actualException = null; try { indexDefinition.propertyType(); } catch (final IllegalStateException e) { actualException = e; } assertNotNull(actualException); }