CharSequence (@NotNull CharSequence sequence, long delayMillis) { long myTime = System.currentTimeMillis() + delayMillis; return new BombedCharSequence(sequence) { @Override protected void checkCanceled() { long l = System.currentTimeMillis(); if (l >= myTime) { throw new ProcessCanceledException(); } } }; }