BZ-10519: added removeDuplicates as a function

Signed-off-by: Paden <padenportillo@gmail.com>