private List < Bean > findReferences ( BeanId reference , Collection < Bean > predecessors , ArrayList < Bean > matches , ArrayList < Bean > checked ) { for ( Bean predecessor : predecessors ) { findReferences ( reference , predecessor , matches , checked ) ; } return matches ; }
Does a recursive check if predecessor have a particular reference and if so return those predecessor references .