title: How to check if the subdomain is also from same domain using java
body: <p>i have a list of url's i need to filter specific domain and subdomain. say i have some domains like</p>
  
  <pre><code>http://www.example.com
  http://test.example.com
  http://test2.example.com
  </code></pre>
  
  <p>I need to extract urls which from domain example.com.</p>