title: Product flavors, how to use custom class
body: <p>I found this <a href="https://developer.android.com/tools/building/configuring-gradle.html" rel="nofollow">link</a> but I have doubts.
  I have some doubts about Product flavors in android studio. I have a structure something like this:</p>
  
  <p>app > src > main > java > com > mycompany > product > packages(view/ utils/ etc)</p>
  
  <pre><code>      &gt; app2 &gt; java &gt; com &gt; mycompany &gt; product &gt; packages(view/ utils/ etc)
  
        &gt; app3 &gt; java &gt; com &gt; mycompany &gt; product &gt; packages(view/ utils/ etc)
  </code></pre>
  
  <ol>
  <li><p>How can I use a <code>class</code> in the <code>main</code> pack but with changes of code snippets for a specific build? I know there is the possibility of using a <code>buildConfigField</code> with a flag for use <code>if</code> and use code snippets in a class, but I think it bad and was wondering if you can use the same class or other means to use these snippets of code. I tried to create the same package structure and create a personalized copy of the class, but Android Studio complains of double class, something that does not occur with the <code>res</code> files.</p></li>
  <li><p>How can I generate apks in <code>debug</code> and simultaneous <code>release</code> for each build.</p></li>
  <li><p>How do simultaneous tests for each build.</p></li>
  </ol>