### Question:
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; } MerkleTree(MessageDigest digest);  MerkleTree(MessageDigest digest, List<byte[]> dataList); List<Node> getNodes(); List<Node> getLeaves(); Node getRoot(); void appendLeaf(Node node); void appendLeaves(Node[] nodes); void appendLeaf(byte[] value); void appendLeaves(byte[][] values); void appendHashedLeaves(byte[][] hashes); @Override boolean equals(Object o);  }### Answer:
@Test public void testGetNodeOrderedNodeIndexes() { int[] ordered = MerkleTree.orderNodeIndexes(new int[]{0, 2, 4, 5}, new int[]{1, 3, 6, 7}); Assertions.assertArrayEquals(new int[]{0, 4, 2, 5, 1, 6, 3, 7}, ordered); ordered = MerkleTree.orderNodeIndexes(new int[]{0, 2, 4, 5, 8, 9, 10, 11}, new int[]{1, 3, 6, 7, 12, 13, 14, 15}); Assertions.assertArrayEquals(new int[]{0, 8, 4, 9, 2, 10, 5, 11, 1, 12, 6, 13, 3, 14, 7, 15}, ordered); ordered = MerkleTree.orderNodeIndexes(new int[]{0, 2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23}, new int[]{ 1, 3, 6, 7, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31}); Assertions.assertArrayEquals(new int[]{ 0, 16, 8, 17, 4, 18, 9, 19, 2, 20, 10, 21, 5, 22, 11, 23, 1, 24, 12, 25, 6, 26, 13, 27, 3, 28, 14, 29, 7, 30, 15, 31}, ordered); }