public int findNextIndex(int current) {
    SearchResult result = new SearchResult();
    int max = myPainter.getErrorStripeCount() - 1;
    if (0 <= current && current < max) {
      result.updateForward(myPainter, current + 1, max);
      result.updateForward(myPainter, 0, current);
    }
    else if (0 <= max) {
      result.updateForward(myPainter, 0, max);
    }
    return result.index;
  }
public int findNextIndex(int current)