code: @Override
      public V put(final CharSequence key, final V value) {
          final CharSequence checkedKey = keyCheck(key);
          final int keyLength = checkedKey.length();
          final V replacedValue;
          TrieNode<V> currentNode = getRoot();
          TrieNode<V> lastNode = null;
          int i = 0;
  
          while (i < keyLength && currentNode != null) {
              lastNode = currentNode;
              currentNode = currentNode.children.get(checkedKey.charAt(i));
              ++i;
          }
  
          if (currentNode == null) {
              /* We could not find the node for the given key, so create it */
              currentNode = lastNode;
              final TrieNode<V> newNode = new TrieNode<V>(true);
  
              addNode(currentNode, checkedKey, --i, newNode);
              modifyData(newNode, value);
              replacedValue = null;
          } else if (currentNode.inUse) {
  			/* We found the node and it is in use, so replace the value */
              replacedValue = currentNode.value;
  
              if (replacedValue != value
                      && (replacedValue == null || !replacedValue.equals(value))) {
                  currentNode.value = value;
              }
          } else {
  			/* We found a node that is not in use, so just set the value */
              modifyData(currentNode, value);
              currentNode.inUse = true;
              replacedValue = null;
          }
  
          return replacedValue;
      }
docs: {@inheritDoc}