private boolean doesItemMatchAppropriateCondition ( Object item ) { Matcher < ? > matcher ; if ( item instanceof View ) { matcher = loaded ( ) ; } else if ( item instanceof Element ) { matcher = displayed ( ) ; } else { matcher = present ( ) ; } return matcher . matches ( item ) ; }
Takes an object and determines a condition for that object that should satisfy the containing view is loaded . Different conditions are made depending on the type of object .