WidgetState (@Nullable VirtualFile file) { Pair<WidgetState, VirtualFile> lastStateAndFilePair = myLastWidgetStateAndFilePair; WidgetState widgetState = calcWidgetState(file, Pair.getFirst(lastStateAndFilePair), Pair.getSecond(lastStateAndFilePair)); myLastWidgetStateAndFilePair = new Pair<>(widgetState, file); return widgetState; }