I actually did some stuff with this quite recently; my image tracking code outputs an angle that the robot should be at, and this angle is fed into a PIDController. For testing, I wanted this same setup to remain there, but also didn't want it to be doing anything.
2 things I learned about the PIDController: 1) it does not like either its PIDSource or its PIDOutput being null. It will crash if either is null. 2) interface/abstract class implementation is extremely convenient.
The basic setup I had was this:
Code:
PIDController pid = new PIDController(PID_P,PID_I,PID_D,
new PIDSource() { public double pidGet() { return 0; } },
new PIDOutput() { public void pidWrite(double) {} });
This let me set and get the PIDController's setpoint without messing anything up, and at the same time made it so that when I actually got the PIDController up and running, I wouldn't have to change too much.
If you wanted to put in a valid PIDSource that would work just as well.