public static boolean vote(Proposal proposal, int optionId) {
        Vote vote = new Vote(FOTE.getUser().getId(), optionId, proposal.getId());
        VoteModel voteModel = new VoteModel();

        // Try to find a vote already made by this user for this proposal
        Iterable<Entry> voteQuery = voteModel.query("{userID: " + vote.getUserID()
                + ",proposalID: " + vote.getProposalID() + "}");
        // If a vote is found remove it from the DB and the object
        if (voteQuery.iterator().hasNext()) {
            Vote deleteVote = (Vote) voteQuery.iterator().next();
            //deleteVote = (Vote) voteModel.get(deleteVote);
            MongoHelper.delete(deleteVote, "votes");
            System.out.println("PREVIOUS VOTE DELETED!");
            for (Integer i : proposal.getVotes()) {
                Vote v = (Vote) voteModel.get(i);
                if (v != null) {
                    System.out.println(v);
                    if (v.getProposalID() == deleteVote.getProposalID()
                            && v.getUserID() == deleteVote.getUserID()) {
                        deleteVote = v;
                    }
                }
            }
            proposal.getVotes().remove(deleteVote);
        }
        // Otherwise we just add the vote to the DB and object
        if (MongoHelper.save(vote, "votes")) {
            vote = (Vote) MongoHelper.fetch(vote, "votes");
            proposal.getVotes().add(vote.getId());
            if (MongoHelper.save(proposal, "proposals")) {
                return true;
            }
        }
        return false;
    }