private Set unionIPRange(byte[] ipWithSubmask1,byte[] ipWithSubmask2){
  Set set=new HashSet();
  if (Arrays.areEqual(ipWithSubmask1,ipWithSubmask2)) {
    set.add(ipWithSubmask1);
  }
 else {
    set.add(ipWithSubmask1);
    set.add(ipWithSubmask2);
  }
  return set;
}

private Set unionIPRange ( byte [ ] ipWithSubmask1 , byte [ ] ipWithSubmask2 ) { Set set = new HashSet ( ) ; if ( Arrays . areEqual ( ipWithSubmask1 , ipWithSubmask2 ) ) { set . add ( ipWithSubmask1 ) ; } else { set . add ( ipWithSubmask1 ) ; set . add ( ipWithSubmask2 ) ; } return set ; }
calculates the union if two ip ranges .
