@Test
@FixFor("MODE-1489")
public void shouldAllowMultipleOrderBeforeWithoutSave() throws Exception {

    int childCount = 2;
    Node parent = session.getRootNode().addNode("parent", "nt:unstructured");
    try {
        for (int i = 0; i < childCount; i++) {
            parent.addNode("Child " + i, "nt:unstructured");
        }
        session.save();
        long childIdx = 0;
        NodeIterator nodeIterator = parent.getNodes();
        while (nodeIterator.hasNext()) {
            parent.orderBefore("Child " + childIdx, "Child 0");
            childIdx++;
            nodeIterator.nextNode();
        }
        session.save();
        nodeIterator = parent.getNodes();
        childIdx = nodeIterator.getSize() - 1;
        while (nodeIterator.hasNext()) {
            Node child = nodeIterator.nextNode();
            assertEquals("Child " + childIdx, child.getName());
            childIdx--;
        }
    } finally {
        parent.remove();
        session.save();
    }
}