static boolean [ ] compactArray ( boolean [ ] array , int index , int length ) { if ( index == 0 && length == array . length ) { return array ; } return Arrays . copyOfRange ( array , index , index + length ) ; }
Returns an array containing elements in the specified range of the specified array . If the range matches the entire array the input array will be returned . Otherwise a copy will be returned .