public static List<User> getNsimilarUsers(int userId, String theDay)
			throws SQLException {
		List<User> result = new LinkedList<User>();
		List<User> zeUsers = users;
		if (zeUsers == null)
			zeUsers = getUsers();
		List<UserAndWeight> usrwgh = new LinkedList<UserAndWeight>();
		MoviesAndRatings mar1 = getVotedItemsForUser(userId, theDay);
		for (int o = 0; o < zeUsers.size(); o++) {
			User u = zeUsers.get(o);
			if (u.getUserID() != userId) {
				MoviesAndRatings mar2 = getVotedItemsForUser(u.getUserID(),
						theDay);
				double si = similarity(userId, u.getUserID(), mar1, mar2);
				if (!Double.isNaN(si))
					usrwgh.add(new UserAndWeight(u, si));
			}
		}

		Collections.sort(usrwgh, new UserWeightComparator());
		if (usrwgh.size() >= topN) {
			for (int i = 0; i < topN; i++) {
				System.out.println(usrwgh.get(i).getUser().getUserID()
						+ " with similarity " + usrwgh.get(i).getWeight());
				result.add(usrwgh.get(i).getUser());
			}
		} else {
			for (int j = 0; j < usrwgh.size(); j++) {
				result.add(usrwgh.get(j).getUser());
			}
		}
		return result;
	}