<p>I'm looking for a Java library that is geared towards network math and already tested.  Nothing particularly fancy, just something to hold ips and subnets, and do things like print a subnet mask or calculate whether an IP is within a given subnet.  </p>

<p>Should I roll my own, or is there already a robust library for this?</p>

org.apache.lenya.ac.IPRange
appears to have these features.
The Apache Lenya project is an open-source content management system.  It uses the Apache License, so you may be able to reuse just the code you need. (But as always, read the
license
yourself; don't trust legal advice from some guy on the internet! :-)