code: public static NetworkInterface getInterfaceForLocalIp(InetAddress addr) throws SocketException, NoInterfaceException
  	{
  		assert (getLocalIpAddresses(false).contains(addr)) : "IP is not local";
  
  		NetworkInterface iface = NetworkInterface.getByInetAddress(addr);
  
  		if (iface != null)
  			return iface;
  		else
  			throw new NoInterfaceException("No network interface for IP: " + addr.toString());
  	}
docs: Given a local IP address, returns the Interface it corresponds to
  
  @param addr
  The address
  
  @return The interface, or null if no interface corresponds to that address
  
  @throws SocketException
  @throws NoInterfaceException
  If there's no corresponding interface for the given IP