I moved most of the function to a couple of PJUtils methods, but I shouldn't have removed the test case.  I'll reinstate it.