### Question:
ContractCheckingIndexProxy extends DelegatingIndexProxy { @Override public IndexUpdater newUpdater( IndexUpdateMode mode ) { if ( IndexUpdateMode.ONLINE == mode ) { openCall( "update" ); return new DelegatingIndexUpdater( super.newUpdater( mode ) ) { @Override public void close() throws IndexEntryConflictException { try { delegate.close(); } finally { closeCall(); } } }; } else { return super.newUpdater( mode ); } } ContractCheckingIndexProxy( IndexProxy delegate, boolean started ); @Override void start(); @Override IndexUpdater newUpdater( IndexUpdateMode mode ); @Override void force( IOLimiter ioLimiter ); @Override void drop(); @Override void close();  }### Answer:
@Test( expected = IllegalStateException.class ) public void shouldNotUpdateBeforeCreate() throws Exception { IndexProxy inner = mockIndexProxy(); IndexProxy outer = newContractCheckingIndexProxy( inner ); try ( IndexUpdater updater = outer.newUpdater( IndexUpdateMode.ONLINE ) ) { updater.process( null ); } }