### Question:
UpdateNISGroup extends AbstractNISOp { static String listToString(List<? extends Object> users, String separator) { StringBuilder result = new StringBuilder(); Iterator<? extends Object> iter = users.iterator(); while (iter.hasNext()) { Object user = iter.next(); result.append(user.toString()); if (iter.hasNext()) { result.append(separator); } } return result.toString(); }  static void updateGroup(SolarisEntry group, SolarisConnection conn);  }### Answer:
@Test public void testListFormatter() { List<String> users = CollectionUtil.newList("foo", "bar", "baz"); String separator = ","; String result = UpdateNISGroup.listToString(users, separator); AssertJUnit.assertEquals("foo,bar,baz", result.trim()); users = CollectionUtil.newList("foo"); result = UpdateNISGroup.listToString(users, separator); AssertJUnit.assertEquals("foo", result.trim()); }