void () { TodoPattern pattern = new TodoPattern("newtodo", TodoAttributesUtil.createDefault(), true); TodoPattern[] oldPatterns = TodoConfiguration.getInstance().getTodoPatterns(); checkTodos(new String[]{"2.java"}); TodoConfiguration.getInstance().setTodoPatterns(new TodoPattern[]{pattern}); PlatformTestUtil.dispatchAllEventsInIdeEventQueue(); try{ checkTodos(new String[]{"1.java"}); } finally{ TodoConfiguration.getInstance().setTodoPatterns(oldPatterns); PlatformTestUtil.dispatchAllEventsInIdeEventQueue(); checkTodos(new String[]{"2.java"}); } }