title: Generating certain methods for variables automatically
body: <p>I have a question of how, if possible, one can generate methods automatically by only providing variable of a spefic kind.</p>
  
  <p><strong>Let's illustrate my question with simple example: </strong>
  Assuming I have multiple variables linked to LinkedLists and I would like to give each certain methods; for example setters and getters methods:</p>
  
  <pre><code>private LinkedList football = new LinkedList();
  private LinkedList jogging = new LinkedList();
  
  public LinkedList getFootball() {
      return football;
  }
  public void setFootball(LinkedList football) {
      this.football = football;
  }
  public LinkedList getJogging() {
      return jogging;
  }
  public void setJogging(LinkedList jogging) {
      this.jogging = jogging;
  }
  </code></pre>
  
  <p>If number of variables gets long (example only contains 2), this will produce very long and rather repetetive peace of code, illustrated above.</p>
  
  <p>Is there any way, if this is indeed a possability, to generalize the above pattern so I can create both methods by just creating an instance of LinkedList?</p>
  
  <p>P.S.: using foreach loop and generalizing it for arbitrary element does NOT WORK.</p>