private Person analyzeChild ( final Person child , final Person prevChild ) { Person retChild = prevChild ; if ( retChild == null ) { return child ; } final LocalDate birthDate = getNearBirthEventDate ( child ) ; if ( birthDate == null ) { return retChild ; } final LocalDate prevDate = getNearBirthEventDate ( prevChild ) ; if ( prevDate == null ) { return child ; } if ( birthDate . isBefore ( prevDate ) ) { final String message = String . format ( CHILD_ORDER_FORMAT , child . getName ( ) . getString ( ) , birthDate , prevChild . getName ( ) . getString ( ) , prevDate ) ; getResult ( ) . addMismatch ( message ) ; } retChild = child ; return retChild ; }
Check the order of one child against the previous dated child .