gt:                     if ( !( that.get( key ) == that.getNoEntryValue() &&
context: ///////////////////////////////////////////////////////////////////////////////
  // Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
  // Copyright (c) 2009, Rob Eden All Rights Reserved.
  // Copyright (c) 2009, Jeff Randall All Rights Reserved.
  //
  // This library is free software; you can redistribute it and/or
  // modify it under the terms of the GNU Lesser General Public
  // License as published by the Free Software Foundation; either
  // version 2.1 of the License, or (at your option) any later version.
  //
  // This library is distributed in the hope that it will be useful,
  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  // GNU General Public License for more details.
  //
  // You should have received a copy of the GNU Lesser General Public
  // License along with this program; if not, write to the Free Software
  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  ///////////////////////////////////////////////////////////////////////////////
  
  package main.java.gnu.trove.map.hash;
  
  
  
  import java.io.*;
  import java.util.*;
  
  import main.java.gnu.trove.TByteCollection;
  import main.java.gnu.trove.function.TByteFunction;
  import main.java.gnu.trove.impl.Constants;
  import main.java.gnu.trove.impl.HashFunctions;
  import main.java.gnu.trove.impl.hash.THash;
  import main.java.gnu.trove.impl.hash.TObjectHash;
  import main.java.gnu.trove.iterator.TByteIterator;
  import main.java.gnu.trove.iterator.TObjectByteIterator;
  import main.java.gnu.trove.iterator.hash.TObjectHashIterator;
  import main.java.gnu.trove.map.TObjectByteMap;
  import main.java.gnu.trove.procedure.TByteProcedure;
  import main.java.gnu.trove.procedure.TObjectByteProcedure;
  import main.java.gnu.trove.procedure.TObjectProcedure;
  
  
  //////////////////////////////////////////////////
  // THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
  //////////////////////////////////////////////////
  
  
  /**
   * An open addressed Map implementation for Object keys and byte values.
   *
   * Created: Sun Nov  4 08:52:45 2001
   *
   * @author Eric D. Friedman
   * @author Rob Eden
   * @author Jeff Randall
   */
  public class TObjectByteHashMap<K> extends TObjectHash<K>
      implements TObjectByteMap<K>, Externalizable {
  
      static final long serialVersionUID = 1L;
  
      private final TObjectByteProcedure<K> PUT_ALL_PROC = new TObjectByteProcedure<K>() {
          public boolean execute(K key, byte value) {
              put(key, value);
              return true;
          }
      };
  
      /** the values of the map */
      protected transient byte[] _values;
  
      /** the value that represents null */
      protected byte no_entry_value;
  
  
      /**
       * Creates a new <code>TObjectByteHashMap</code> instance with the default
       * capacity and load factor.
       */
      public TObjectByteHashMap() {
          super();
          no_entry_value = Constants.DEFAULT_BYTE_NO_ENTRY_VALUE;
      }
  
  
      /**
       * Creates a new <code>TObjectByteHashMap</code> instance with a prime
       * capacity equal to or greater than <tt>initialCapacity</tt> and
       * with the default load factor.
       *
       * @param initialCapacity an <code>int</code> value
       */
      public TObjectByteHashMap( int initialCapacity ) {
          super( initialCapacity );
          no_entry_value = Constants.DEFAULT_BYTE_NO_ENTRY_VALUE;
      }
  
  
      /**
       * Creates a new <code>TObjectByteHashMap</code> instance with a prime
       * capacity equal to or greater than <tt>initialCapacity</tt> and
       * with the specified load factor.
       *
       * @param initialCapacity an <code>int</code> value
       * @param loadFactor a <code>float</code> value
       */
      public TObjectByteHashMap( int initialCapacity, float loadFactor ) {
          super( initialCapacity, loadFactor );
          no_entry_value = Constants.DEFAULT_BYTE_NO_ENTRY_VALUE;
      }
  
  
      /**
       * Creates a new <code>TObjectByteHashMap</code> instance with a prime
       * value at or near the specified capacity and load factor.
       *
       * @param initialCapacity used to find a prime capacity for the table.
       * @param loadFactor used to calculate the threshold over which
       * rehashing takes place.
       * @param noEntryValue the value used to represent null.
       */
      public TObjectByteHashMap( int initialCapacity, float loadFactor, byte noEntryValue ) {
          super( initialCapacity, loadFactor );
          no_entry_value = noEntryValue;
          //noinspection RedundantCast
          if ( no_entry_value != ( byte ) 0 ) {
              Arrays.fill( _values, no_entry_value );
          }
      }
  
  
      /**
       * Creates a new <code>TObjectByteHashMap</code> that contains the entries
       * in the map passed to it.
       *
       * @param map the <tt>TObjectByteMap</tt> to be copied.
       */
      public TObjectByteHashMap( TObjectByteMap<? extends K> map ) {
          this( map.size(), 0.5f, map.getNoEntryValue() );
          if ( map instanceof TObjectByteHashMap ) {
              TObjectByteHashMap hashmap = ( TObjectByteHashMap ) map;
              this._loadFactor = hashmap._loadFactor;
              this.no_entry_value = hashmap.no_entry_value;
              //noinspection RedundantCast
              if ( this.no_entry_value != ( byte ) 0 ) {
                  Arrays.fill( _values, this.no_entry_value );
              }
              setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
          }
          putAll( map );
      }
  
  
      /**
       * initializes the hashtable to a prime capacity which is at least
       * <tt>initialCapacity + 1</tt>.
       *
       * @param initialCapacity an <code>int</code> value
       * @return the actual capacity chosen
       */
      public int setUp( int initialCapacity ) {
          int capacity;
  
          capacity = super.setUp( initialCapacity );
          _values = new byte[capacity];
          return capacity;
      }
  
  
      /**
       * rehashes the map to the new capacity.
       *
       * @param newCapacity an <code>int</code> value
       */
      protected void rehash( int newCapacity ) {
          int oldCapacity = _set.length;
  
          //noinspection unchecked
          K oldKeys[] = ( K[] ) _set;
          byte oldVals[] = _values;
  
          _set = new Object[newCapacity];
          Arrays.fill( _set, FREE );
          _values = new byte[newCapacity];
          Arrays.fill( _values, no_entry_value );
  
          for ( int i = oldCapacity; i-- > 0; ) {
            if( oldKeys[i] != FREE && oldKeys[i] != REMOVED ) {
                  K o = oldKeys[i];
                  int index = insertKey(o);
                  if ( index < 0 ) {
                      throwObjectContractViolation( _set[ (-index -1) ], o);
                  }
                  _set[index] = o;
                  _values[index] = oldVals[i];
              }
          }
      }
  
  
      // Query Operations
  
      /** {@inheritDoc} */
      public byte getNoEntryValue() {
          return no_entry_value;
      }
  
  
      /** {@inheritDoc} */
      public boolean containsKey( Object key ) {
          return contains( key );
      }
  
  
      /** {@inheritDoc} */
      public boolean containsValue( byte val ) {
          Object[] keys = _set;
          byte[] vals = _values;
  
          for ( int i = vals.length; i-- > 0; ) {
              if ( keys[i] != FREE && keys[i] != REMOVED && val == vals[i] ) {
                  return true;
              }
          }
          return false;
      }
  
  
      /** {@inheritDoc} */
      public byte get( Object key ) {
          int index = index( key );
          return index < 0 ? no_entry_value : _values[index];
      }
  
  
      // Modification Operations
  
      /** {@inheritDoc} */
      public byte put( K key, byte value ) {
          int index = insertKey( key );
          return doPut( value, index );
      }
  
  
      /** {@inheritDoc} */
      public byte putIfAbsent( K key, byte value ) {
          int index = insertKey(key);
          if ( index < 0 )
              return _values[-index - 1];
          return doPut( value, index );
      }
  
  
      private byte doPut( byte value, int index ) {
          byte previous = no_entry_value;
          boolean isNewMapping = true;
          if ( index < 0 ) {
              index = -index -1;
              previous = _values[index];
              isNewMapping = false;
          }
          //noinspection unchecked
          _values[index] = value;
  
          if ( isNewMapping ) {
              postInsertHook( consumeFreeSlot );
          }
          return previous;
      }
  
  
      /** {@inheritDoc} */
      public byte remove( Object key ) {
          byte prev = no_entry_value;
          int index = index(key);
          if ( index >= 0 ) {
              prev = _values[index];
              removeAt( index );    // clear key,state; adjust size
          }
          return prev;
      }
  
  
      /**
       * Removes the mapping at <tt>index</tt> from the map.
       * This method is used internally and public mainly because
       * of packaging reasons.  Caveat Programmer.
       *
       * @param index an <code>int</code> value
       */
      protected void removeAt( int index ) {
          _values[index] = no_entry_value;
          super.removeAt( index );  // clear key, state; adjust size
      }
  
  
      // Bulk Operations
  
      /** {@inheritDoc} */
      public void putAll( Map<? extends K, ? extends Byte> map ) {
          Set<? extends Map.Entry<? extends K,? extends Byte>> set = map.entrySet();
          for ( Map.Entry<? extends K,? extends Byte> entry : set ) {
              put( entry.getKey(), entry.getValue() );
          }
      }
      
  
      /** {@inheritDoc} */
      public void putAll( TObjectByteMap<? extends K> map ){
          map.forEachEntry( PUT_ALL_PROC );
      }
  
  
      /** {@inheritDoc} */
      public void clear() {
          super.clear();
          Arrays.fill( _set, 0, _set.length, FREE );
          Arrays.fill( _values, 0, _values.length, no_entry_value );
      }
  
  
      // Views
  
      /** {@inheritDoc} */
      public Set<K> keySet() {
          return new KeyView();
      }
  
  
      /** {@inheritDoc} */
      public Object[] keys() {
          //noinspection unchecked
          K[] keys = ( K[] ) new Object[size()];
          Object[] k = _set;
  
          for ( int i = k.length, j = 0; i-- > 0; ) {
              if ( k[i] != FREE && k[i] != REMOVED ) {
                  //noinspection unchecked
                  keys[j++] = ( K ) k[i];
              }
          }
          return keys;
      }
  
  
      /** {@inheritDoc} */
      public K[] keys( K[] a ) {
          int size = size();
          if ( a.length < size ) {
              //noinspection unchecked
              a = ( K[] ) java.lang.reflect.Array.newInstance(
                            a.getClass().getComponentType(), size );
          }
  
          Object[] k = _set;
  
          for ( int i = k.length, j = 0; i-- > 0; ) {
              if ( k[i] != FREE && k[i] != REMOVED ) {
                  //noinspection unchecked
                  a[j++] = ( K ) k[i];
              }
          }
          return a;
      }
  
  
      /** {@inheritDoc} */
      public TByteCollection valueCollection() {
          return new TByteValueCollection();
      }
  
  
      /** {@inheritDoc} */
      public byte[] values() {
          byte[] vals = new byte[size()];
          byte[] v = _values;
          Object[] keys = _set;
  
          for ( int i = v.length, j = 0; i-- > 0; ) {
              if ( keys[i] != FREE && keys[i] != REMOVED ) {
                  vals[j++] = v[i];
              }
          }
          return vals;
      }
  
  
      /** {@inheritDoc} */
      public byte[] values( byte[] array ) {
          int size = size();
          if ( array.length < size ) {
              array = new byte[size];
          }
  
          byte[] v = _values;
          Object[] keys = _set;
  
          for ( int i = v.length, j = 0; i-- > 0; ) {
              if ( keys[i] != FREE && keys[i] != REMOVED ) {
                  array[j++] = v[i];
              }
          }
          if ( array.length > size ) {
              array[size] = no_entry_value;
          }
          return array;
      }
  
  
      /**
       * @return an iterator over the entries in this map
       */
      public TObjectByteIterator<K> iterator() {
          return new TObjectByteHashIterator<K>( this );
      }
  
  
      /** {@inheritDoc} */
      @SuppressWarnings({"RedundantCast"})
      public boolean increment( K key ) {
          //noinspection RedundantCast
          return adjustValue( key, (byte)1 );
      }
  
  
      /** {@inheritDoc} */
      public boolean adjustValue( K key, byte amount ) {
          int index = index(key);
          if ( index < 0 ) {
              return false;
          } else {
              _values[index] += amount;
              return true;
          }
      }
  
  
      /** {@inheritDoc} */
      public byte adjustOrPutValue( final K key, final byte adjust_amount,
  		final byte put_amount ) {
  
          int index = insertKey( key );
          final boolean isNewMapping;
          final byte newValue;
          if ( index < 0 ) {
              index = -index -1;
              newValue = ( _values[index] += adjust_amount );
              isNewMapping = false;
          } else {
              newValue = ( _values[index] = put_amount );
              isNewMapping = true;
          }
  
          //noinspection unchecked
  
          if ( isNewMapping ) {
              postInsertHook( consumeFreeSlot );
          }
  
          return newValue;
      }
  
  
      /**
       * Executes <tt>procedure</tt> for each key in the map.
       *
       * @param procedure a <code>TObjectProcedure</code> value
       * @return false if the loop over the keys terminated because
       * the procedure returned false for some key.
       */
      public boolean forEachKey( TObjectProcedure<? super K> procedure ) {
          return forEach( procedure );
      }
  
  
      /**
       * Executes <tt>procedure</tt> for each value in the map.
       *
       * @param procedure a <code>TByteProcedure</code> value
       * @return false if the loop over the values terminated because
       * the procedure returned false for some value.
       */
      public boolean forEachValue( TByteProcedure procedure ) {
          Object[] keys = _set;
          byte[] values = _values;
          for ( int i = values.length; i-- > 0; ) {
              if ( keys[i] != FREE && keys[i] != REMOVED
                  && ! procedure.execute( values[i] ) ) {
                  return false;
              }
          }
          return true;
      }
  
  
      /**
       * Executes <tt>procedure</tt> for each key/value entry in the
       * map.
       *
       * @param procedure a <code>TOObjectByteProcedure</code> value
       * @return false if the loop over the entries terminated because
       * the procedure returned false for some entry.
       */
      @SuppressWarnings({"unchecked"})
      public boolean forEachEntry( TObjectByteProcedure<? super K> procedure ) {
          Object[] keys = _set;
          byte[] values = _values;
          for ( int i = keys.length; i-- > 0; ) {
              if ( keys[i] != FREE
                  && keys[i] != REMOVED
                  && ! procedure.execute( ( K ) keys[i], values[i] ) ) {
                  return false;
              }
          }
          return true;
      }
  
  
      /**
       * Retains only those entries in the map for which the procedure
       * returns a true value.
       *
       * @param procedure determines which entries to keep
       * @return true if the map was modified.
       */
      public boolean retainEntries( TObjectByteProcedure<? super K> procedure ) {
          boolean modified = false;
          //noinspection unchecked
          K[] keys = ( K[] ) _set;
          byte[] values = _values;
  
          // Temporarily disable compaction. This is a fix for bug #1738760
          tempDisableAutoCompaction();
          try {
              for ( int i = keys.length; i-- > 0; ) {
                  if ( keys[i] != FREE
                      && keys[i] != REMOVED
                      && ! procedure.execute( keys[i], values[i] ) ) {
                      removeAt(i);
                      modified = true;
                  }
              }
          }
          finally {
              reenableAutoCompaction( true );
          }
  
          return modified;
      }
  
  
      /**
       * Transform the values in this map using <tt>function</tt>.
       *
       * @param function a <code>TByteFunction</code> value
       */
      public void transformValues( TByteFunction function ) {
          Object[] keys = _set;
          byte[] values = _values;
          for ( int i = values.length; i-- > 0; ) {
              if ( keys[i] != null && keys[i] != REMOVED ) {
                  values[i] = function.execute( values[i] );
              }
          }
      }
  
  
      // Comparison and hashing
  
      /**
       * Compares this map with another map for equality of their stored
       * entries.
       *
       * @param other an <code>Object</code> value
       * @return a <code>boolean</code> value
       */
      public boolean equals( Object other ) {
          if ( ! ( other instanceof TObjectByteMap ) ) {
              return false;
          }
          TObjectByteMap that = ( TObjectByteMap ) other;
          if ( that.size() != this.size() ) {
              return false;
          }
          try {
              TObjectByteIterator iter = this.iterator();
              while ( iter.hasNext() ) {
                  iter.advance();
                  Object key = iter.key();
                  byte value = iter.value();
                  if ( value == no_entry_value ) {
  