Unit test for method: reorderForLinks