class MerkleTree {

    static int[] orderNodeIndexes(int[] left, int[] right) {
        Objects.requireNonNull(left, "left cannot be null");
        Objects.requireNonNull(right, "right cannot be null");
        if (left.length != right.length) {
            throw new IllegalArgumentException("Branch size mismatch");
        }
        if (!isPowerOfTwo(left.length)) {
            throw new IllegalArgumentException("Size of branch is not power of two");
        }

        int branchLength = left.length;
        int[] ordered = new int[2 * branchLength];
        int[] leftOrdered = orderNodes(left);
        int[] rightOrdered = orderNodes(right);
        System.arraycopy(leftOrdered, 0, ordered, 0, branchLength);
        System.arraycopy(rightOrdered, 0, ordered, branchLength, branchLength);
        return ordered;
    }

    public  MerkleTree(MessageDigest digest);
    public  MerkleTree(MessageDigest digest, List<byte[]> dataList);

}