### Question:
CompiledIndexUtils { public static NodeValueIndexCursor indexSeek( Read read, CursorFactory cursors, IndexReference index, Object value ) throws KernelException { assert index.properties().length == 1; if ( value == Values.NO_VALUE || value == null ) { return NodeValueIndexCursor.EMPTY; } else { NodeValueIndexCursor cursor = cursors.allocateNodeValueIndexCursor(); IndexQuery.ExactPredicate query = exact( index.properties()[0], makeValueNeoSafe( value ) ); read.nodeIndexSeek( index, cursor, IndexOrder.NONE, false, query ); return cursor; } } private  CompiledIndexUtils(); static NodeValueIndexCursor indexSeek( Read read, CursorFactory cursors, IndexReference index, Object value );  }### Answer:
@Test public void shouldCallIndexSeek() throws KernelException { Read read = mock( Read.class ); IndexReference index = mock( IndexReference.class ); when( index.properties() ).thenReturn( new int[]{42} ); CompiledIndexUtils.indexSeek( read, mock( CursorFactory.class ), index, "hello" ); verify( read, times( 1 ) ).nodeIndexSeek( any(), any(), any(), anyBoolean(), any() ); }
@Test public void shouldHandleNullInIndexSeek() throws KernelException { Read read = mock( Read.class ); IndexReference index = mock( IndexReference.class ); when( index.properties() ).thenReturn( new int[]{42} ); NodeValueIndexCursor cursor = CompiledIndexUtils.indexSeek( mock( Read.class ), mock( CursorFactory.class ), index, null ); verify( read, never() ).nodeIndexSeek( any(), any(), any(), anyBoolean() ); assertFalse( cursor.next() ); }