code: public void registerCandidate(Class<?> candidateClass, String description, Candidate.CandidateType type) {
        Candidate candidate = new Candidate(candidateClass, description, type);
        int index = candidates.indexOf(candidate);
        if(index >= 0) {
           Candidate existingCandidate = candidates.get(index);
           if(!description.equals(existingCandidate.getDescription())) {
              throw new IllegalStateException("Two different descriptions for candidate " + candidateClass.getName());
           }
           existingCandidate.getTypes().add(type);
        }
        else {
           candidates.add(candidate);
        }
     }
docs: Register a candidate class to attempt to instantiate.
  
  @param candidateClass Class to attempt to instantiate
  @param description Description of the class