/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	String nome;
	
	public Ideone(String nome){
			this.nome = nome;
		}

	public static void main (String[] args) throws java.lang.Exception
	{
		Ideone a = new Ideone("AAA");
		Ideone b = new Ideone("BBB");
		Ideone c = new Ideone("CCC");
		Ideone copiaa = new Ideone("AAA");
		
		System.out.println("a & b :" + a.equals(b));
		System.out.println("a & copia a :" + a.equals(copiaa));
		
		List<Ideone> lista = new ArrayList<Ideone>();
		
		lista.add(a);
		lista.add(b);
		
		System.out.println("contains a :" + lista.contains(a));
		System.out.println("contains c :" + lista.contains(c));
		System.out.println("contains a em copia a :" + lista.contains(copiaa));
	}

	@Override
	public boolean equals(Object other){
		if (!(other instanceof Ideone)){
			return false;
		}

		if (other == this){
			return true;
		}
		
		Ideone temp = (Ideone) other;
		
		return (this.nome.equals(temp.nome));
	}

}