### Question:
IndexTxStateUpdater { void onLabelChange( int labelId, int[] existingPropertyKeyIds, NodeCursor node, PropertyCursor propertyCursor, LabelChangeType changeType ) { assert noSchemaChangedInTx(); Collection<SchemaDescriptor> indexes = indexingService.getRelatedIndexes( new long[]{labelId}, existingPropertyKeyIds, NODE ); if ( !indexes.isEmpty() ) { MutableIntObjectMap<Value> materializedProperties = IntObjectMaps.mutable.empty(); for ( SchemaDescriptor index : indexes ) { int[] indexPropertyIds = index.schema().getPropertyIds(); Value[] values = getValueTuple( node, propertyCursor, NO_SUCH_PROPERTY_KEY, NO_VALUE, indexPropertyIds, materializedProperties ); switch ( changeType ) { case ADDED_LABEL: indexingService.validateBeforeCommit( index.schema(), values ); read.txState().indexDoUpdateEntry( index.schema(), node.nodeReference(), null, ValueTuple.of( values ) ); break; case REMOVED_LABEL: read.txState().indexDoUpdateEntry( index.schema(), node.nodeReference(), ValueTuple.of( values ), null ); break; default: throw new IllegalStateException( changeType + " is not a supported event" ); } } } } IndexTxStateUpdater( Read read, IndexingService indexingService );   }### Answer:
@Test public void shouldNotUpdateIndexesOnChangedIrrelevantLabel() { indexTxUpdater.onLabelChange( unIndexedLabelId, props, node, propertyCursor, ADDED_LABEL ); indexTxUpdater.onLabelChange( unIndexedLabelId, props, node, propertyCursor, REMOVED_LABEL ); verify( txState, never() ).indexDoUpdateEntry( any(), anyInt(), any(), any() ); }
@Test public void shouldUpdateIndexesOnAddedLabel() { indexTxUpdater.onLabelChange( labelId1, props, node, propertyCursor, ADDED_LABEL ); verifyIndexUpdate( indexOn1_1.schema(), node.nodeReference(), null, values( "hi1" ) ); verifyIndexUpdate( uniqueOn1_2.schema(), node.nodeReference(), null, values( "hi2" ) ); verify( txState, times( 2 ) ).indexDoUpdateEntry( any(), anyLong(), isNull(), any() ); }
@Test public void shouldUpdateIndexesOnRemovedLabel() { indexTxUpdater.onLabelChange( labelId2, props, node, propertyCursor, REMOVED_LABEL ); verifyIndexUpdate( uniqueOn2_2_3.schema(), node.nodeReference(), values( "hi2", "hi3" ), null ); verify( txState, times( 1 ) ).indexDoUpdateEntry( any(), anyLong(), any(), isNull() ); }