private static boolean startsWith ( String [ ] left , List < String > right ) { // short circuit if a match isn't possible if ( left . length < right . size ( ) ) { return false ; } for ( int i = 0 ; i < right . size ( ) ; i += 1 ) { if ( ! left [ i ] . equals ( right . get ( i ) ) ) { return false ; } } return true ; }
Returns true if left starts with right .