Here you can find the source of minus(InetAddress[] a_, InetAddress[] b)
static final public InetAddress[] minus(InetAddress[] a_, InetAddress[] b)
//package com.java2s; //License from project: Apache License import java.net.InetAddress; public class Main { static final public InetAddress[] minus(InetAddress[] a_, InetAddress[] b) { InetAddress[] a = (InetAddress[]) a_.clone(); for (int i = 0; i < b.length; i++) for (int j = 0; j < a.length; j++) if (b[i].equals(a[j])) a[j] = null;/*from ww w. ja v a 2 s. c o m*/ return removeNull(a); } public final static InetAddress[] removeNull(InetAddress addrs[]) { int count = 0; for (int i = 0; i < addrs.length; i++) if (addrs[i] != null) count++; InetAddress[] result = new InetAddress[count]; count = 0; for (int i = 0; i < addrs.length; i++) if (addrs[i] != null) result[count++] = addrs[i]; return result; } }