class LivenessQueryService {

    /**
     * Logger.
     */
    private static final Logger LOGGER = LogManager.getLogger(LivenessQueryService.class);

    /**
     * Liveness repository.
     */
    @Inject
    private LivenessRepository livenessRepository;

    /**
     * Gets point of current liveness.
     *
     * @param userId the specified user id
     * @return point
     */
    public int getCurrentLivenessPoint(final String userId) {<FILL_FUNCTION_BODY>}

    /**
     * Gets the yesterday's liveness.
     *
     * @param userId the specified user id
     * @return yesterday's liveness, returns {@code null} if not found
     */
    public JSONObject getYesterdayLiveness(final String userId) {
        final Date yesterday = DateUtils.addDays(new Date(), -1);
        final String date = DateFormatUtils.format(yesterday, "yyyyMMdd");

        try {
            return livenessRepository.getByUserAndDate(userId, date);
        } catch (final RepositoryException e) {
            LOGGER.log(Level.ERROR, "Gets yesterday's liveness failed", e);

            return null;
        }
    }
}

        Stopwatchs.start("Gets liveness");
        try {
            final String date = DateFormatUtils.format(new Date(), "yyyyMMdd");

            try {
                final JSONObject liveness = livenessRepository.getByUserAndDate(userId, date);
                if (null == liveness) {
                    return 0;
                }

                return Liveness.calcPoint(liveness);
            } catch (final RepositoryException e) {
                LOGGER.log(Level.ERROR, "Gets current liveness point failed", e);

                return 0;
            }
        } finally {
            Stopwatchs.end();
        }
    
<no_super_class>