code: public boolean replaceElement(@Nonnull final ExpressionTreeElement oldOne, @Nonnull final ExpressionTreeElement newOne) {
      assertNotEmptySlot();
  
      if (oldOne == null) {
        throw new PreprocessorException("[Expression]The old element is null", this.sourceString, this.includeStack, null);
      }
  
      if (newOne == null) {
        throw new PreprocessorException("[Expression]The new element is null", this.sourceString, this.includeStack, null);
      }
  
      boolean result = false;
  
      final ExpressionTreeElement[] children = childElements;
      final int len = children.length;
  
      for (int i = 0; i < len; i++) {
        if (children[i] == oldOne) {
          children[i] = newOne;
          newOne.parentTreeElement = this;
          result = true;
          break;
        }
      }
      return result;
    }
docs: It replaces a child element
  
  @param oldOne the old expression element to be replaced (must not be null)
  @param newOne the new expression element to be used instead the old one (must not be null)
  @return true if the element was found and replaced, else false