class AuthorizationTree implements AuthorizationInfo {

    @Override
    public Optional<List<AuthorizationNode>> getAuthorizationLineage(String blockchainAddress) {
        // Find a strand that contains a node with the given blockchain address as authorized (each strand is ordered from
        // root to leaf)
        Optional<List<AuthorizationNode>> strandAsList =
            tree.getStrands()
                .map(strand -> strand.collect(Collectors.toList()))
                .filter(strand -> strand.stream().anyMatch(node -> node.getAddress().equals(blockchainAddress)))
                .findFirst();

        // If we find the strand, build a path from node to root
        if (strandAsList.isPresent()) {
            final List<AuthorizationNode> result = new ArrayList<>();

            for (AuthorizationNode node : strandAsList.get()) {
                result.add(node);

                // add nodes up until the one we need
                if (node.getAddress().equals(blockchainAddress))
                    break;
            }

            return Optional.of(result);
        } else {
            return Optional.empty();
        }
    }

    public  AuthorizationTree(List<AuthorizationElement> allAuthorizationElements);

}