private String spanString(final Person person) {
        final GetDateVisitor birthVisitor = new GetDateVisitor("Birth");
        person.accept(birthVisitor);
        final String birthYear = birthVisitor.getYear();
        final GetDateVisitor deathVisitor = new GetDateVisitor("Death");
        person.accept(deathVisitor);
        final String deathYear = deathVisitor.getYear();

        String spanString;
        if (birthYear.isEmpty() && deathYear.isEmpty()) {
            spanString = "";
        } else {
            spanString = " (" + birthYear + "-" + deathYear + ")";
        }
        return spanString;
    }
private String spanString ( final Person person ) { final GetDateVisitor birthVisitor = new GetDateVisitor ( "Birth" ) ; person . accept ( birthVisitor ) ; final String birthYear = birthVisitor . getYear ( ) ; final GetDateVisitor deathVisitor = new GetDateVisitor ( "Death" ) ; person . accept ( deathVisitor ) ; final String deathYear = deathVisitor . getYear ( ) ; String spanString ; if ( birthYear . isEmpty ( ) && deathYear . isEmpty ( ) ) { spanString = "" ; } else { spanString = " (" + birthYear + "-" + deathYear + ")" ; } return spanString ; }
@param person the person whose lifespan we are getting
@return the lifespan string (can be empty)