code: public boolean remove(Object key, Object val) {
          String k = key.toString();
          
         // synchronized( this ) {
              V item;
              
              if( !containsKey(k) ) {
                  return false;
              }
              item = get(k);
              if( val == null && item == null ) {
                  remove(k);
                  return true;
              }
              if( val == null || item == null ) {
                  return false;
              }
              if( val.equals(item) ) {
                  remove(k);
                  return true;
              }
         // }
          return false;
      }
docs: Removes the specified key only if the current value equals the specified value.
  If the value does not match the current value, the removal will not occur.
  @param key the key to be removed
  @param val the value that must be matched by the current value for this key