Test code for java persistence