Java, takes lists of IP addresses and merges them