Java check if IPv4 or IPv6 address is in a given subnet

How can I check if an IP address is in a given subnet? I was able to do this by using Apache Commons SubnetUtils (SubnetUtils.SubnetInfo.isInRange) but it does not support IPv6 yet.