Java Set Array Equal To Another Arraylist Sort Method Javascript