Here you can find the source of getRandomInterests()
private static String[] getRandomInterests()
//package com.java2s; //License from project: Open Source License import java.util.HashSet; import java.util.Random; import java.util.Set; public class Main { private static final Random r = new Random(System.currentTimeMillis()); /**/*from w w w .j a v a 2 s . c o m*/ * @return */ private static String[] getRandomInterests() { final String[] interests = { "bioinformatics", "web development", "semantic web", "requiremens analysis", "system modeling", "project planning", "project management", "software engineering", "software development", "technical writing" }; Set<String> finalInterests = new HashSet<String>(); for (int i = 0; i < 3; i++) { finalInterests.add(interests[r.nextInt(interests.length)]); } return finalInterests.toArray(new String[0]); } }