title: Java 3 dots parameter (varargs) behavior when passed no arguments or null
body: <p>I tried this and get weird behavior from JAVA, can someone explain this for me?</p>
  
  <pre><code>boolean testNull(String... string) {
      if(string == null) {
          return true;
      } else {
          System.out.println(string.getClass());
          return false;
      }
  }
  
  boolean callTestNull(String s) {
      return testNull(s);
  }
  </code></pre>
  
  <p>Then I have test case:</p>
  
  <pre><code>    @Test
      public void test_cases() {
          assertTrue(instance.testNull(null)); // NULL
          assertFalse(instance.testNull()); // NOT NULL
          assertFalse(instance.callTestNull(null)); // NOT NULL
      }
  </code></pre>
  
  <p>The question is if I call <code>testNull()</code> directly with parameter <code>null</code>, I will get <code>true</code> back, but if call <code>callTestNull()</code> with <code>null</code>, which calls <code>testNull()</code>, it tells me the parameter is not null, but empty array.</p>