Made CandidateState immutable and testable