code: protected void removeSiblings(final NodeData node)
     {
        if (node.getIdentifier().equals(Constants.ROOT_UUID))
        {
           return;
        }
  
        // remove child nodes of the item parent recursive
        writeLock.lock();
        try
        {
           // remove on-parent child nodes list
           nodesCache.remove(node.getParentIdentifier());
  
           // go through the C and remove every descendant of the node parent
           final QPath path = node.getQPath().makeParentPath();
           final List<CacheId> toRemove = new ArrayList<CacheId>();
  
           // find and remove by path
           for (Iterator<Map.Entry<CacheKey, CacheValue>> citer = cache.entrySet().iterator(); citer.hasNext();)
           {
              Map.Entry<CacheKey, CacheValue> ce = citer.next();
              CacheKey key = ce.getKey();
              CacheValue v = ce.getValue();
              if (v != null)
              {
                 if (key.isDescendantOf(path))
                 {
                    // will remove by id too
                    toRemove.add(new CacheId(v.getItem().getIdentifier()));
  
                    citer.remove(); // remove
  
                    nodesCache.remove(v.getItem().getIdentifier());
                    propertiesCache.remove(v.getItem().getIdentifier());
                 }
              }
              else
              {
                 citer.remove(); // remove empty C record
              }
           }
  
           for (CacheId id : toRemove)
           {
              cache.remove(id);
           }
  
           toRemove.clear();
  
        }
        finally
        {
           writeLock.unlock();
        }
     }
docs: Remove sibling's subtrees from cache C, CN, CP.<br> For update (order-before) usecase.<br>
  The work does remove of all descendants of the item parent. I.e. the node and its siblings (for
  SNS case).<br>