NominatingCandidateRequest implements Serializable { public Candidate toCandidate() { return new Candidate(candidateId, candidateName, candidateEmail, TrainingId.from(trainingId)); } NominatingCandidateRequest();  NominatingCandidateRequest(String ticketId,
                                      String trainingId,
                                      String candidateId,
                                      String candidateName,
                                      String candidateEmail,
                                      String nominatorId,
                                      String nominatorName,
                                      String nominatorEmail,
                                      TrainingRole nominatorRole); TicketId getTicketId(); TrainingId getTrainingId(); String getCandidateId(); String getCandidateName(); String getCandidateEmail(); String getNominatorId(); String getNominatorName(); String getNominatorEmail(); TrainingRole getNominatorRole(); Candidate toCandidate(); Nominator toNominator();  }
@Test public void should_compose_Candidate() { nominatingCandidateRequest = createNominationRequest(); Candidate candidate = nominatingCandidateRequest.toCandidate(); assertThat(candidate.employeeId()).isEqualTo(candidateId); assertThat(candidate.name()).isEqualTo(candidateName); assertThat(candidate.email()).isEqualTo(candidateEmail); assertThat(candidate.trainingId()).isEqualTo(TrainingId.from(trainingId)); }