@Override
  public int indexOfValue( String valueName ) {
    if ( valueName == null ) {
      return -1;
    }

    lock.writeLock().lock();
    try {
      Integer index = cache.findAndCompare( valueName, valueMetaList );
      for ( int i = 0; ( index == null ) && ( i < valueMetaList.size() ); i++ ) {
        if ( valueName.equalsIgnoreCase( valueMetaList.get( i ).getName() ) ) {
          index = i;
          // it is possible, that several threads can call storing simultaneously
          // but it makes no harm as they will put the same value,
          // because valueMetaList is defended from modifications by read lock
          cache.storeMapping( valueName, index );
          needRealClone = null;
        }
      }
      if ( index == null ) {
        return -1;
      }
      return index;
    } finally {
      lock.writeLock().unlock();
    }
  }
@Test
  public void testIndexOfValue() {
    List<ValueMetaInterface> list = rowMeta.getValueMetaList();
    assertEquals( 0, list.indexOf( string ) );
    assertEquals( 1, list.indexOf( integer ) );
    assertEquals( 2, list.indexOf( date ) );
  }