### Question:
RetriveUnrepeats { public static String unRepeatUids(String oldUids, String[] newUids) { StringBuffer result = new StringBuffer(); HashSet<String> oldSet = new HashSet<>(); for (String uid : oldUids.split(",")) { oldSet.add(uid); } for (String uid : newUids) { if (!oldSet.contains(uid)) { result.append(uid).append(","); } } if (result.length() > 1) { return result.toString().substring(0, result.length() - 1); } else { return ""; } }  static String unRepeatUids(String oldUids, String[] newUids); static String contactUids(String oldUids, String[] newUids);  }### Answer:
@Test public void testUnRepeatUids() { assertEquals("777777,888888", RetriveUnrepeats.unRepeatUids(oldUids, newUids)); }
@Test public void testStressUnRepeatUids() throws Exception { assertEquals(676, oldFans.split(",").length); assertEquals(5000, newFans.split(",").length); assertEquals(5000, RetriveUnrepeats.unRepeatUids(oldFans, newFans.split(",")).split(",").length); }