title: Any way to find whether the IPAddress falls in Private Range
body: <p>I am working on code where I need to find whether the ipAddress belongs to Private Range or not. Any suggestions will be appreciated.</p>
  
  <p>UPDATED-</p>
  
  <p>This is my method-</p>
  
  <pre><code>    if(isPrivateIPAddress(ipAddress)) {
  
       //do whatever you want
  
  }
  
  
  
  private static boolean isPrivateIPAddress(InetAddress address, String range) {
      // TODO Auto-generated method stub
      String ipAddress = address.getHostAddress();
      return ipAddress.startsWith( range );
  }
  </code></pre>
  
  <p>So I am not sure what is the address we need to pass in the above if loop.</p>