title: Using superclass "protected final" methods to keep common code for subclasses
body: <p>As a (pedantic) beginner Java programmer I would like to know, is it a good practice to move a common block of code that all subclasses use to a separate <strong>protected</strong> (<strong>final</strong>) method in parent class? Tasks like filling lists with common values, or common filtering algorithms, etc...
  Is it good to also use <strong>protected static</strong> methods?</p>
  
  <pre class="lang-java prettyprint-override"><code>class A {
      protected final List&lt;String&gt; getVariants() {...}
      protected final List&lt;String&gt; filterResults(List&lt;String&gt; variants) {...}
  }
  
  class B extends A {
      public List&lt;String&gt; doSomethingUsefull() {
          List&lt;String&gt; commonVariants = getVariants();
          ...
          return filterResults(commonVariants);
      }
  }
  
  class C extends A {
      public void doSomethingUsefull() {
          List&lt;String&gt; commonVariants = getVariants();
          ...
          return filterResults(commonVariants);
      }
  
      public void doMoreUsefullThings() {
          List&lt;String&gt; commonVariants = getVariants();
          ...
          return filterResults(commonVariants);
      }
  }
  </code></pre>