Code example for TimeoutException

0
            throw new AssertionError(ex);
        } 
 
        if (!success)
        { 
            throw new TimeoutException("Truncate timed out - received only " + responses.get() + " responses");
        } 
    } 
 
    public void response(Message message)
    { 
        responses.incrementAndGet();
        if (responses.get() >= responseCount)
            condition.signal();
    } 
 
    public boolean isLatencyForSnitch() 
    { 
        return false; 
    } 
}