Editor (PlaybackContext context) { TypingTarget typingTarget = findTarget(context); if (typingTarget == null) throw new IllegalStateException("typingTarget is null"); if (!(typingTarget instanceof EditorComponentImpl)) throw new IllegalStateException("typingTarget is not EditorComponentImpl, but " + typingTarget.getClass()); return ((EditorComponentImpl) typingTarget).getEditor(); }