Statement stmt = conn.createStatement();
stmt.executeUpdate("LISTEN mynotification");
stmt.executeUpdate("NOTIFY mynotification, 'message'");
PGNotification notifications[] = ((org.postgresql.PGConnection)conn).getNotifications();
assertNotNull(notifications);
assertEquals(1, notifications.length);
assertEquals("mynotification", notifications[0].getName());
assertEquals("message", notifications[0].getParameter());