quickPerm java implementation