Implement constructor and equals() method.