jill/src/main/java/io/github/agentsoz/jill/lang/PlanBindings.java
private Belief getResultAtIndex(Set<Belief> results, int index) {
    Belief belief = null;
    if (!(results == null || index < 0 || index >= results.size())) {
      int idx = 0;
      for (Belief b : results) {
        if (idx == index) {
          belief = b;
          break;
        }
        idx++;
      }
    }
    return belief;
  }
private Belief getResultAtIndex(Set<Belief> results, int index) {
    Belief belief = null;
    if (!(results == null || index < 0 || index >= results.size())) {
      int idx = 0;
      for (Belief b : results) {
        if (idx == index) {
          belief = b;
          break;
        }
        idx++;
      }
    }
    return belief;
  }
Gets the result at the given index from the results set.

@param results results set (implementation must support predictable iteration order)
@param index the index within the set {@code (0 < index < results.size())} to retrieve
@return the result at the given index, or null if there was an error