public class Symbol { private char symbol; public Symbol(char symbol) { this.symbol = symbol; } public void setSymbol(char symbol) { this.symbol = symbol; } public char getSymbol() { // this is painful. return symbol; } public String toString() { char[] arr = new char[1]; arr[0] = this.symbol; return new String(arr); } public boolean equals(Symbol o) { return this.symbol == o.symbol; } }