title: Undocumented, mysterious class--rubbish, or a design pattern I don't know?
body: <p>I inherited the following code:</p>
  
  <p>(Some names are changed to protect the innocent.)</p>
  
  <pre><code>package foo.bar.baz;
  import javax.swing.JPanel;
  
  //Main panel in the GUI
  class DemoRootPanel extends JPanel {
      private final MainGUIClass demo;
  
      DemoRootPanel(MainGUIClass demo) {
          super();   
          this.demo = demo;
      }
  
      public MainGUIClass getDragAndDropPanelsDemo() {
          return demo;
      }
  }
  </code></pre>
  
  <p>I didn't immediately see why it was important, so I grepped through the source tree to see it being used. These are all the results:</p>
  
  <pre><code>$ ack -i rootpanel
  DemoRootPanel.java
  5:class DemoRootPanel extends JPanel {
  8:    DemoRootPanel(MainGUIClass demo) {
  
  MainGUIClass.java
  70: private final DemoRootPanel rootPanel;
  124:        rootPanel = new DemoRootPanel(MainGUIClass.this);
  821:                    containerPanels.add(new ContainerPanel(rootPanel));
  846:                            containerPanels.add(new ContainerPanel(rootPanel));
  1777:               ContainerPanel newContainer = new ContainerPanel(rootPanel);
  
  ContainerPanel.java
  30: DemoRootPanel rootPanel;
  49: public ContainerPanel(DemoRootPanel rootPanel) {
  51:     this.rootPanel = rootPanel;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$ ack getDragAndDropPanelsDemo
  DemoRootPanel.java
  13:    public PileSortGUI getDragAndDropPanelsDemo() {
  </code></pre>
  
  <p>So as far as I see, it's completely unnecessary. But this is my first job, I haven't been to college yet, etcetera, so I'm wondering if it's not some idiom that's important but unfamiliar to me.</p>
  
  <p><em>PS - I'm also relatively new to SO. I believe this question can be answered definitively, but it does seem less technical than normal. If it's not okay, let me know and I'll take it down. (Or just mod it :P )</em></p>