fixed Java implementation of dedup test