class ContextBuilder {

  private final String startMarker;
  private final String endMarker;

  public ContextBuilder() {
    this.startMarker = "_START_";
    this.endMarker = "_END_";
  }
  
  public ContextBuilder(String startMarker, String endMarker) {
    this.startMarker = startMarker;
    this.endMarker = endMarker;
  }
  
  public List<String> getContext(AnalyzedTokenReadings[] tokens, int pos, int contextSize) {
    List<String> l = new ArrayList<>();
    int i = 0;
    for (AnalyzedTokenReadings token : tokens) {
      if (i == pos) {
        l.addAll(getLeftContext(tokens, pos, contextSize));
        l.add(token.getToken());
        l.addAll(getRightContext(tokens, pos, contextSize));
        break;
      }
      i++;
    }
    return l;
  }

  private List<String> getLeftContext(AnalyzedTokenReadings[] tokens, int pos, int contextSize) {<FILL_FUNCTION_BODY>}

  private List<String> getRightContext(AnalyzedTokenReadings[] tokens, int pos, int contextSize) {
    List<String> l = new ArrayList<>();
    for (int i = pos + 1; i <= tokens.length && l.size() < contextSize; i++) {
      if (i == tokens.length) {
        l.add(endMarker);
      } else {
        l.add(tokens[i].getToken());
      }
    }
    return l;
  }
}

    List<String> l = new ArrayList<>();
    for (int i = pos - 1; i >= 0 && l.size() < contextSize; i--) {
      if (i == 0) {
        l.add(0, startMarker);
      } else {
        l.add(0, tokens[i].getToken());
      }
    }
    return l;
  
<no_super_class>