Remove Duplicates from Sorted Array II  in Java