docs: public Deferred<Boolean> storeLeaf(final TSDB tsdb, final byte[] branch_id, 
        final Tree tree) {
      
      /**
       * Callback executed with the results of our CAS operation. If the put was
       * successful, we just return. Otherwise we load the existing leaf to
       * determine if there was a collision.
       */
      final class LeafStoreCB implements Callback<Deferred<Boolean>, Boolean> {
  
        final Leaf local_leaf;
        
        public LeafStoreCB(final Leaf local_leaf) {
          this.local_leaf = local_leaf;
        }
        
        /**
         * @return True if the put was successful or the leaf existed, false if 
         * there was a collision
         */
        @Override
        public Deferred<Boolean> call(final Boolean success) throws Exception {
          if (success) {
            return Deferred.fromResult(success);
          }
          
          /**
           * Called after fetching the existing leaf from storage
           */
          final class LeafFetchCB implements Callback<Deferred<Boolean>, Leaf> {
            
            /**
             * @return True if the put was successful or the leaf existed, false if 
             * there was a collision
             */
            @Override
            public Deferred<Boolean> call(final Leaf existing_leaf) 
              throws Exception {
              if (existing_leaf == null) {
                LOG.error(
                    "Returned leaf was null, stored data may be corrupt for leaf: "
                    + Branch.idToString(columnQualifier()) + " on branch: "
                    + Branch.idToString(branch_id));
                return Deferred.fromResult(false);
              }
              
              if (existing_leaf.tsuid.equals(tsuid)) {
                LOG.debug("Leaf already exists: " + local_leaf);
                return Deferred.fromResult(true);
              }
              
              tree.addCollision(tsuid, existing_leaf.tsuid);
              LOG.warn("Branch ID: [" + Branch.idToString(branch_id)  
                  + "] Leaf collision with [" + tsuid + 
                  "] on existing leaf [" + existing_leaf.tsuid + 
                  "] named [" + display_name + "]");
              return Deferred.fromResult(false);
            }
            
          }
          
          // fetch the existing leaf so we can compare it to determine if we have
          // a collision or an existing leaf
          return Leaf.getFromStorage(tsdb, branch_id, display_name)
            .addCallbackDeferring(new LeafFetchCB());
        }
        
      }
      
      // execute the CAS call to start the callback chain
      final PutRequest put = new PutRequest(tsdb.treeTable(), branch_id, 
          Tree.TREE_FAMILY(), columnQualifier(), toStorageJson());
      return tsdb.getClient().compareAndSet(put, new byte[0])
        .addCallbackDeferring(new LeafStoreCB(this));
    }