title: Solve equation in Java with modulo
body: <p>I need to solve this equation in my Java app:</p>
  
  <pre><code>(1080 * j + 1) modulo 7 = 0
  </code></pre>
  
  <p>Is there some more safe way how to get this value instead of this code? I am not much happy with <code>while</code> loop condition.</p>
  
  <pre><code>    int j = 1;
      int e = 7;
      boolean found = false;
      double r = 0;
  
      while (!found) {
          r = (1080 * j + 1);
          found = r % e == 0;
          j++;
      }
  
      int t = (int) (r / e);
  </code></pre>