Java tutorial
//package com.java2s; import java.util.Set; public class Main { public static int addToWordSet(Set<String> wordSet, String words) { String[] r = words.split(","); int count = 0; for (String word : r) { wordSet.add(word); count++; } return count; } }