### Question:
FusionIndexAccessor extends FusionIndexBase<IndexAccessor> implements IndexAccessor { @Override public void validateBeforeCommit( Value[] tuple ) { instanceSelector.select( slotSelector.selectSlot( tuple, GROUP_OF ) ).validateBeforeCommit( tuple ); } FusionIndexAccessor( SlotSelector slotSelector,
            InstanceSelector<IndexAccessor> instanceSelector,
            StoreIndexDescriptor descriptor,
            IndexDropAction dropAction ); @Override void drop(); @Override IndexUpdater newUpdater( IndexUpdateMode mode ); @Override void force( IOLimiter ioLimiter ); @Override void refresh(); @Override void close(); @Override IndexReader newReader(); @Override BoundedIterable<Long> newAllEntriesReader(); @Override ResourceIterator<File> snapshotFiles(); @Override Map<String,Value> indexConfig(); @Override void verifyDeferredConstraints( NodePropertyAccessor nodePropertyAccessor ); @Override boolean isDirty(); @Override void validateBeforeCommit( Value[] tuple ); @Override boolean consistencyCheck( ReporterFactory reporterFactory );  }### Answer:
@Test public void shouldFailValueValidationIfAnyPartFail() { IllegalArgumentException failure = new IllegalArgumentException( "failing" ); for ( int i = 0; i < aliveAccessors.length; i++ ) { for ( int j = 0; j < aliveAccessors.length; j++ ) { if ( i == j ) { doThrow( failure ).when( aliveAccessors[i] ).validateBeforeCommit( ArgumentMatchers.any( Value[].class ) ); } else { doAnswer( invocation -> null ).when( aliveAccessors[i] ).validateBeforeCommit( any( Value[].class ) ); } } try { fusionIndexAccessor.validateBeforeCommit( new Value[] {stringValue( "something" )} ); } catch ( IllegalArgumentException e ) { assertSame( failure, e ); } } }
@Test public void shouldSucceedValueValidationIfAllSucceed() { fusionIndexAccessor.validateBeforeCommit( new Value[] {stringValue( "test value" )} ); }