class SentOutputTask implements Runnable {

    private static final Logger log = LoggerFactory.getLogger(SentOutputTask.class);

    Session session;
    Long sessionId;
    User user;

    public SentOutputTask(Long sessionId, Session session, User user) {
        this.sessionId = sessionId;
        this.session = session;
        this.user = user;
    }

    public void run() {<FILL_FUNCTION_BODY>}
}

        Gson gson = new Gson();
        while (session.isOpen()) {
            try {
                Connection con = DBUtils.getConn();
                List<SessionOutput> outputList = SessionOutputUtil.getOutput(con, sessionId, user);
                if (!outputList.isEmpty()) {
                    String json = gson.toJson(outputList);
                    //send json to session
                    this.session.getBasicRemote().sendText(json);
                }
                Thread.sleep(25);
                DBUtils.closeConn(con);
            } catch (SQLException | GeneralSecurityException | IOException | InterruptedException ex) {
                log.error(ex.toString(), ex);
            }
        }
    
<no_super_class>