public LocalDate estimateFromSiblings ( final LocalDate localDate ) { if ( localDate != null ) { return localDate ; } boolean beforePerson = true ; LocalDate date = null ; int increment = typicals . gapBetweenChildren ( ) ; final PersonNavigator navigator = new PersonNavigator ( person ) ; final List < Family > families = navigator . getFamiliesC ( ) ; for ( final Family family : families ) { for ( final Person sibling : getChildren ( family ) ) { if ( person . equals ( sibling ) ) { beforePerson = false ; if ( date != null ) { break ; } increment = 0 ; continue ; } final String siblingString = getBirthDate ( sibling ) ; if ( ! validDateString ( siblingString ) ) { increment = incrementWhenEmptyDate ( beforePerson , increment ) ; continue ; } date = createLocalDate ( siblingString ) ; increment = incrementWhenDate ( beforePerson , increment ) ; if ( ! beforePerson ) { break ; } } } if ( date != null ) { date = firstDayOfMonth ( plusYears ( date , increment ) ) ; } return date ; }
Try estimating from sibling dates . Null if no siblings or siblings also don t have dates .