title: Same computational flow, but different functionalities
body: <p>Recently I wrote a small piece of code for my project need and the code works fine...</p>
  
  <p>Below code is a generalized version....</p>
  
  <pre><code>if (someConditionX)
      {
          if (Utils.nullOrEmpty(string1))
          {
              Config config = getConfig();
  
              if (config != null)
              {
                  doA();
              }
          }
          else
          {
              doB();
          }
  
          if (Utils.nullOrEmpty(string2))
          {
              Config config = getConfig();
  
              if (config != null)
              {
                  doC();
              }
          }
          else
          {
              doD();
          }
      }
      else if (someConditionY)
      {
          if (Utils.nullOrEmpty(string1))
          {
              Config config = getConfig();
  
              if (config != null)
              {
                  doE();
              }
          }
          else
          {
              doF();
          }
  
          if (Utils.nullOrEmpty(string2))
          {
              Config config = getConfig();
  
              if (config != null)
              {
                  doG();
              }
          }
          else
          {
              doH();
          }
      }
  </code></pre>
  
  <p>I am not convinced the way it is written and I feel there is a scope for improvement to make it better........</p>
  
  <p>Please give me some suggestions to make it better... Is there a scope to use lambdas ??.........</p>