title: Why in this JUnit test it shows wrong number?
body: <p>So here is my solution code:</p>
  
  <pre><code>public int count_two_char(String s, char c, char d){
      int count = 0;
      int count1 = 0;
  
      for (int i = 0; i &lt; s.length(); i++) {
          if (s.charAt(i) == c) {
              count = count + 1;
          }
  
          for (int i1 = 0; i1 &lt; s.length(); i1++) {
              if (s.charAt(i1) == d) {
                  count1 = count1 + 1;
              }
          }
      }
      return count + count1;
  }
  </code></pre>
  
  <p>And here is my test code:</p>
  
  <pre><code>@Test
  public void tests3() {
      code.Solution s =  new code.Solution();
      String input = "llss";
      int expected = 4;
      char c ='l';
      char d ='s';
      int actual = s.count_two_char(input, c, d);
      assertTrue("Expected was" +expected+"but the actual was" +actual  ,  expected == actual);
  }
  </code></pre>
  
  <p>But when I test it. It shows a error which is expected was 4 but the actual was 10. why?? I'm so confuse right now.</p>