Source:
<code>public ImmutableBitmap getBitmapIndex(BitmapIndexSelector selector) { if (extractionFn == null && likeMatcher.getSuffixStyle() == LikeDimFilter.LikeMatcher.SuffixStyle.MATCH_EMPTY) { return selector.getBitmapIndex(dimension, likeMatcher.getPrefix()); } else if (extractionFn == null) { final BitmapIndex bitmapIndex = selector.getBitmapIndex(dimension); if (bitmapIndex == null) { return likeMatcher.matches(null) ? Filters.allTrue(selector) : Filters.allFalse(selector); } final Indexed<String> dimValues = selector.getDimensionValues(dimension); final String lower = Strings.nullToEmpty(likeMatcher.getPrefix()); final String upper = Strings.nullToEmpty(likeMatcher.getPrefix()) + HIGHEST_CHARACTER; final int startIndex; final int endIndex; final int lowerFound = bitmapIndex.getIndex(lower); startIndex = lowerFound >= 0 ? lowerFound : -(lowerFound + 1); final int upperFound = bitmapIndex.getIndex(upper); endIndex = upperFound >= 0 ? upperFound + 1 : -(upperFound + 1); return selector.getBitmapFactory().union( <START> new Iterable<ImmutableBitmap>() <END> { @Override public Iterator<ImmutableBitmap> iterator() { return new Iterator<ImmutableBitmap>() { int currIndex = startIndex; @Override public boolean hasNext() { return currIndex < endIndex; } @Override public ImmutableBitmap next() { while (currIndex < bitmapIndex.getCardinality() && !( likeMatcher.getSuffixStyle() == LikeDimFilter.LikeMatcher.SuffixStyle.MATCH_ANY || likeMatcher.matches(dimValues.get(currIndex)))) { currIndex++; } if (currIndex == endIndex) { return bitmapIndex.getBitmapFactory().makeEmptyImmutableBitmap(); } return bitmapIndex.getBitmap(currIndex++); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } } ); } else { return Filters.matchPredicate( dimension, selector, likeMatcher.predicateFactory(extractionFn).makeStringPredicate() ); } }</code><technical_language>This Iterable chain of nested classes is noisy. create a simple List of bitmaps, fill in a for loop i startIndex endIndex, return bitmapFactory.union(bitmaps)</technical_language>

Target:
public ImmutableBitmap getBitmapIndex(BitmapIndexSelector selector) { if (extractionFn == null && likeMatcher.getSuffixMatch() == LikeDimFilter.LikeMatcher.SuffixMatch.MATCH_EMPTY) { return selector.getBitmapIndex(dimension, likeMatcher.getPrefix()); } else if (extractionFn == null && !likeMatcher.getPrefix().isEmpty()) { final BitmapIndex bitmapIndex = selector.getBitmapIndex(dimension); if (bitmapIndex == null) { return likeMatcher.matches(null) ? Filters.allTrue(selector) : Filters.allFalse(selector); } final Indexed<String> dimValues = selector.getDimensionValues(dimension); final String lower = Strings.nullToEmpty(likeMatcher.getPrefix()); final String upper = Strings.nullToEmpty(likeMatcher.getPrefix()) + Character.MAX_VALUE; final int startIndex; final int endIndex; final int lowerFound = bitmapIndex.getIndex(lower); startIndex = lowerFound >= 0 ? lowerFound : -(lowerFound + 1); final int upperFound = bitmapIndex.getIndex(upper); endIndex = upperFound >= 0 ? upperFound + 1 : -(upperFound + 1); return selector.getBitmapFactory().union( new Iterable<ImmutableBitmap>() { @Override public Iterator<ImmutableBitmap> iterator() { return new Iterator<ImmutableBitmap>() { int currIndex = startIndex; @Override public boolean hasNext() { return currIndex < endIndex; } @Override public ImmutableBitmap next() { while (currIndex < endIndex && !likeMatcher.matchesSuffixOnly(dimValues.get(currIndex))) { currIndex++; } if (currIndex == endIndex) { return bitmapIndex.getBitmapFactory().makeEmptyImmutableBitmap(); } return bitmapIndex.getBitmap(currIndex++); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } } ); } else { return Filters.matchPredicate( dimension, selector, likeMatcher.predicateFactory(extractionFn).makeStringPredicate() ); } }