class MinimalRenderer extends BaseRenderer implements Renderer {

  @Override
  public TreeNode<Set<String>> finalizeProperties(
      TreeNode<QueryInfo> queryTree, boolean isCollection) {

    QueryInfo queryInfo = queryTree.getObject();
    TreeNode<Set<String>> resultTree = new TreeNodeImpl<>(
      null, queryInfo.getProperties(), queryTree.getName());

    copyPropertiesToResult(queryTree, resultTree);

    m_rootType     = queryTree.getObject().getResource().getType();
    m_isCollection = isCollection;

    boolean addKeysToEmptyResource = true;
    if (! isCollection && isRequestWithNoProperties(queryTree)) {
      addSubResources(queryTree, resultTree);
      addKeysToEmptyResource = false;
    }
    processRequestedProperties(queryTree);
    ensureRequiredProperties(resultTree, addKeysToEmptyResource);

    return resultTree;
  }

}