class LastRequestAliveCheck implements AliveCheck {

    @Override
    public boolean isAlive()
    {
        if(lastRequestMilliseconds != null)
        {
            long currentMilliseconds = System.currentTimeMillis();
            long difference = (currentMilliseconds - lastRequestMilliseconds);
            boolean result = difference < notAliveThresholdMilliseconds;
            if(!result)
                logger.warn(String.format("Last request sent: %1$s ms ago. Threshold: %2$s", difference, notAliveThresholdMilliseconds));
            return result;
        }
        return true;
    }

}