code: protected int toPrevious(int amount) throws FetchException {
          if (amount <= 1) {
              return (amount <= 0) ? 0 : (toPrevious() ? 1 : 0);
          }
  
          int count = 0;
  
          disableKeyAndValue();
          try {
              while (amount > 0) {
                  if (toPrevious()) {
                      count++;
                      amount--;
                  } else {
                      break;
                  }
              }
          } finally {
              enableKeyAndValue();
          }
  
          return count;
      }
docs: Move the cursor to the previous available entry, decrementing by the
  amount given. The actual amount decremented is returned. If the amount
  is less then requested, the cursor must be positioned before the first
  available entry. Subclasses may wish to override this method with a
  faster implementation.
  
  <p>Calling to toPrevious(1) is equivalent to calling toPrevious().
  
  @param amount positive amount to retreat
  @return actual amount retreated
  @throws IllegalStateException if cursor is not opened