/**
 * An example for using Junit
 *
 */
 
public class Fruit {

	private String _kind;
	private double _price;

	/**
	 * Constructs a <code>Fruit</code>.
	 *
	 * @param kind  kind of fruit: apple, orange, ...
	 * @param price price of this fruit
	 */
	public Fruit(String kind, double price) {
		_kind = kind;
		_price = price;
	}

	/**
	 * Returns the fruit kind.
	 *
	 * @return kind.
	 */
	public String getKind() {
		return _kind;
	}

	/**
	 * Returns the fruit price.
	 *
	 * @return Price.
	 */
	public double getPrice() {
		return _price;
	}

	/**
	 * Tests fruit equality.
	 *
	 * @return <code>true</code> if the fruits
	 *         are equal.
	 */
	public boolean equals(Object o) {
	
		if (o instanceof Fruit) {
			Fruit f = (Fruit)o;
			return f.getKind().equals(_kind);
		}

		return false;
	}
}