code: public List<Timestamp> getRevisionTimestampsBeforeRevision(final int revisionId)
          throws WikiApiException
      {
          List<Timestamp> timestamps = new LinkedList<Timestamp>();
  
          int articleID = getPageIdForRevisionId(revisionId); // TODO do this in the SQL query
          Timestamp ts = getRevision(revisionId).getTimeStamp(); // TODO do this in the SQL query
  
          try {
              PreparedStatement statement = null;
              ResultSet result = null;
  
              try {
                  // Check if necessary index exists
                  if (!indexExists("revisions")) {
                      throw new WikiInitializationException(
                              "Please create an index on revisions(ArticleID) in order to make this query feasible.");
                  }
  
                  statement = connection
                          .prepareStatement("SELECT Timestamp FROM revisions WHERE ArticleID=? AND Timestamp < ?");
                  statement.setInt(1, articleID);
                  statement.setLong(2, ts.getTime());
                  result = statement.executeQuery();
  
                  // Make the query
                  if (result == null) {
                      throw new WikiPageNotFoundException("The article with the ID " + articleID
                              + " was not found.");
                  }
                  while (result.next()) {
                      timestamps.add(new Timestamp(result.getLong(1)));
                  }
              }
              finally {
                  if (statement != null) {
                      statement.close();
                  }
                  if (result != null) {
                      result.close();
                  }
              }
  
              return timestamps;
  
          }
          catch (WikiApiException e) {
              throw e;
          }
          catch (Exception e) {
              throw new WikiApiException(e);
          }
      }
docs: Returns the timestamps of all revisions that have been made before the given revision.
  
  @param revisionId
  ID of the article
  @return number of revisions
  
  @throws WikiApiException
  if an error occurs