func (rht *RHT) Elements() map[string]string {
	members := make(map[string]string)
	for _, node := range rht.nodeMapByKey {
		if !node.isRemoved() {
			members[node.key] = node.val
		}
	}
	return members
}
Elements returns a map of elements because the map easy to use for loop.
TODO: If we encounter performance issues, we need to replace this with other solution.
package json
import (
	"fmt"
	"sort"
	"strings"
	"github.com/yorkie-team/yorkie/internal/log"
	"github.com/yorkie-team/yorkie/pkg/document/time"
)
type RHTNode struct {
	key       string
	val       string
	updatedAt *time.Ticket
	removedAt *time.Ticket
}
func newRHTNode(key, val string, updatedAt *time.Ticket) *RHTNode {
	return &RHTNode{
		key:       key,
		val:       val,
		updatedAt: updatedAt,
	}
}
func (n *RHTNode) Remove(removedAt *time.Ticket) {
	if n.removedAt == nil || removedAt.After(n.removedAt) {
		n.removedAt = removedAt
	}
}
func (n *RHTNode) isRemoved() bool {
	return n.removedAt != nil
}
func (n *RHTNode) Key() string {
	return n.key
}
func (n *RHTNode) Value() string {
	return n.val
}
func (n *RHTNode) UpdatedAt() *time.Ticket {
	return n.updatedAt
}
func (n *RHTNode) RemovedAt() *time.Ticket {
	return n.removedAt
}
type RHT struct {
	nodeMapByKey       map[string]*RHTNode
	nodeMapByCreatedAt map[string]*RHTNode
}
func NewRHT() *RHT {
	return &RHT{
		nodeMapByKey:       make(map[string]*RHTNode),
		nodeMapByCreatedAt: make(map[string]*RHTNode),
	}
}
func (rht *RHT) Get(key string) string {
	if node, ok := rht.nodeMapByKey[key]; ok {
		if node.isRemoved() {
			return ""
		}
		return node.val
	}
	return ""
}
func (rht *RHT) Has(key string) bool {
	if node, ok := rht.nodeMapByKey[key]; ok {
		return node != nil && !node.isRemoved()
	}
	return false
}
func (rht *RHT) Set(k, v string, executedAt *time.Ticket) {
	if node, ok := rht.nodeMapByKey[k]; !ok || executedAt.After(node.updatedAt) {
		newNode := newRHTNode(k, v, executedAt)
		rht.nodeMapByKey[k] = newNode
		rht.nodeMapByCreatedAt[executedAt.Key()] = newNode
	}
}
func (rht *RHT) Remove(k string, executedAt *time.Ticket) string {
	if node, ok := rht.nodeMapByKey[k]; ok && executedAt.After(node.removedAt) {
		node.Remove(executedAt)
		return node.val
	}
	return ""
}
func (rht *RHT) RemoveByCreatedAt(createdAt *time.Ticket, removedAt *time.Ticket) string {
	if node, ok := rht.nodeMapByCreatedAt[createdAt.Key()]; ok {
		node.Remove(removedAt)
		return node.val
	}
	log.Logger.Warn("fail to find " + createdAt.Key())
	return ""
}