### Question:
FailedIndexProxy extends AbstractSwallowingIndexProxy { @Override public void drop() { indexCountsRemover.remove(); String message = "FailedIndexProxy#drop index on " + indexUserDescription + " dropped due to:\n" + getPopulationFailure().asString(); log.info( message ); populator.drop(); } FailedIndexProxy( CapableIndexDescriptor capableIndexDescriptor,
            String indexUserDescription,
            IndexPopulator populator,
            IndexPopulationFailure populationFailure,
            IndexCountsRemover indexCountsRemover,
            LogProvider logProvider ); @Override void drop(); @Override InternalIndexState getState(); @Override boolean awaitStoreScanCompleted( long time, TimeUnit unit ); @Override void activate(); @Override void validate(); @Override void validateBeforeCommit( Value[] tuple ); @Override ResourceIterator<File> snapshotFiles(); @Override Map<String,Value> indexConfig();  }### Answer:
@Test public void shouldRemoveIndexCountsWhenTheIndexItselfIsDropped() throws IOException { String userDescription = "description"; FailedIndexProxy index = new FailedIndexProxy( forSchema( forLabel( 1, 2 ), IndexProviderDescriptor.UNDECIDED ).withId( 1 ).withoutCapabilities(), userDescription, indexPopulator, indexPopulationFailure, indexCountsRemover, NullLogProvider.getInstance() ); index.drop(); verify( indexPopulator ).drop(); verify( indexCountsRemover ).remove(); verifyNoMoreInteractions( indexPopulator, indexCountsRemover ); }
@Test public void shouldLogReasonForDroppingIndex() throws IOException { AssertableLogProvider logProvider = new AssertableLogProvider(); new FailedIndexProxy( forSchema( forLabel( 0, 0 ), IndexProviderDescriptor.UNDECIDED ).withId( 1 ).withoutCapabilities(), "foo", mock( IndexPopulator.class ), IndexPopulationFailure.failure( "it broke" ), indexCountsRemover, logProvider ).drop(); logProvider.assertAtLeastOnce( inLog( FailedIndexProxy.class ).info( "FailedIndexProxy#drop index on foo dropped due to:\nit broke" ) ); }