You can use java.awt.Color.RGBtoHSB(...)
You can find the relevant documentation for it here: http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Color.html
Then it just becomes trivial of generating a random color.
int red = (int) (Math.random() * 256)
int green = (int) (Math.random() * 256)
int blue = (int) (Math.random() * 256)
Then convert directly. Note that there is also a HSBtoRGB(...)
function in the same class.