title: How to run PowerMock v1.74 with java.net.InetAddress static method
body: <p>I have been reading a lot about PowerMockito to mock static methods.  So I have been trying to use v1 (not v2), although I don't really care which version of PowerMockito or testNG I use.  I figure I missed some critical detail here in the configuration, but I am at a loss.</p>
  
  <p>Using Oracle Java 1.8</p>
  
  <p>subprojects.gradle:</p>
  
  <pre><code>testCompile group: 'org.testng',                  name: 'testng',               version: '6.14.3'
  testCompile group: 'org.powermock',           name: 'powermock-module-testng',  version: '1.7.4'
  testCompile group: 'org.powermock',           name: 'powermock-api-mockito',    version: '1.7.4'
  </code></pre>
  
  <p>I checked my versioning of modules <a href="https://github.com/powermock/powermock/wiki/Mockito-2-Maven#TestNG" rel="nofollow noreferrer">here</a></p>
  
  <p>Test class</p>
  
  <pre><code>import org.mockito.*;
  import org.mockito.invocation.*;
  import org.mockito.stubbing.*;
  import org.powermock.core.classloader.annotations.*;
  import org.powermock.modules.testng.*;
  import org.testng.*;
  import org.testng.annotations.*;
  
  import java.io.*;
  import java.net.*;
  
  import static org.powermock.api.mockito.PowerMockito.*;
  
  @PrepareForTest({java.net.InetAddress.class})
  public class testClass extends PowerMockTestCase {
    @Test   
    public void exampleTest()
       throws IOException, URISyntaxException, MyCustomException {
  
      mockStatic(InetAddress.class);
      // I use these three functions, so I think I have to mock them all?
      when(InetAddress.getByName(Mockito.anyString()))
          .thenReturn(InetAddresses.forString("111.0.0.111"));    
      when(InetAddress.getByAddress(Mockito.anyObject()))
        .thenCallRealMethod();
      when(InetAddress.getLocalHost()).thenCallRealMethod();
  
      MyNewClass mnc = new MyNewClass();
      mnc.someCodeUsingInetAddress();
    }
  </code></pre>
  
  <p>This compiles and runs, but does not change the behavior of the function InetAddress.getByName() when called from someCodeUsingInetAddress().  </p>
  
  <p>Now I read <a href="https://github.com/powermock/powermock/wiki/Mock-System" rel="nofollow noreferrer">here</a> that I need to label the class with 
  <code>@RunWith(PowerMockRunner.class)</code>.  But IntelliJ won't let me import the PowerMockRunner.class from any of the possible sources, of which it is aware. Which also makes me wonder which one I should be trying to use.</p>
  
  <pre><code>org.testng.PowerMockRunner
  org.testng.annotations.PowerMockRunner
  org.powermock.modules.testng.PowerMockRunner
  </code></pre>
  
  <p>the list goes on...</p>