title: Testing a method with return type void
body: <p>I'm new to software testing. In a tutorial I read that I can test some methods like this:</p>
  
  <pre><code>@Test
   public void testMultiply() {
     MyClass tester = new MyClass();
     assertEquals("10 x 5 must be 50", 50, tester.multiply(10, 5));
   } 
  </code></pre>
  
  <p>So I have to pass some parameters to a method and get a return value.<br>
  But in my case I have some classes without any parameters and return values:  </p>
  
  <pre><code>ArrayList al = new ArrayList();
  
  public void Main(){
    methodA();
    methodB();
  }
  
  public void methodA(){
    // connect to URL
    // get some data
    for(int i=0; i&lt;someThing; i++){
      al.add(data);
    }
  }
  public void methodB(){
    // do something with al
  }
  </code></pre>
  
  <p>Is it also possible to test them? For example whether the right value comes from the URL in <code>methodA()</code>.</p>