Code example for LinkedHashSet

Methods: addAll, size, toArray

0
			return array2;
		} 
		if (array2 == null) {
			return array1;
		} 
		Set<String> set = new LinkedHashSet<String>();
		set.addAll(Arrays.asList(array1));
		set.addAll(Arrays.asList(array2));
		return set.toArray(new String[set.size()]);
	} 
 
	public static String formatList(List<String> list) {
		StringBuilder sb = new StringBuilder();
		if (list != null && list.size() > 0) {
			if (list.size() == 1) {
				sb.append(list.get(0));
			} else if (list.size() == 2) {
				sb.append(list.get(0)).append(" & ").append(list.get(1));
			} else { 
				for (int i = 0; i < list.size(); i++) {
					sb.append(list.get(i));