package com.cobalt.cdpipeline.cdresult;

/**
 * 
 */
public class Contributor {
	private String username;
	
	/**
	 * Constructs a Contributor object.
	 * 
	 * @param username of the contributor
	 */
	public Contributor(String username) {
		this.username = username;
	}
	
	/**
	 * Gets the username of this.
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}
	
	// TODO override equals
}

package com.cobalt.cdpipeline.cdresult;

import java.util.HashSet;

/**
 * 
 */
public class Contributor {
	private String username;
	
	/**
	 * Constructs a Contributor object.
	 * 
	 * @param username of the contributor
	 */
	public Contributor(String username) {
		this.username = username;
	}
	
	/**
	 * Gets the username of this.
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}
	
	@Override
	public boolean equals(Object o){
		if (o instanceof Contributor){
			Contributor other = (Contributor) o;
			if(other.username.equals(this.username)){
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode(){
		return this.username.hashCode();
	}
	
}

Make Contributors with the same username equals to each other so that they won't be dulplicate in one Set: Add Equals check and make the hashcode of Contributor equals hashcode of Contributor.username