void () { XDebuggerHistoryManager manager = XDebuggerHistoryManager.getInstance(getProject()); assertNotNull(manager); manager.addRecentExpression("id1", new XExpressionImpl("0", null, "custom info", EvaluationMode.EXPRESSION)); manager.addRecentExpression("id1", new XExpressionImpl("1", Language.ANY, null, EvaluationMode.CODE_FRAGMENT)); manager.addRecentExpression("id2", new XExpressionImpl("10", null, null, EvaluationMode.EXPRESSION)); Element state = manager.getState(); // modify the state manager.addRecentExpression("id1", new XExpressionImpl("2", null, null, EvaluationMode.EXPRESSION)); manager.addRecentExpression("id3", new XExpressionImpl("3", null, null, EvaluationMode.EXPRESSION)); // rollback to an old state manager.loadState(state); List<XExpression> expressionsByFirstId = manager.getRecentExpressions("id1"); assertEquals(2, expressionsByFirstId.size()); checkExpression(expressionsByFirstId.get(0), "1", Language.ANY, null, EvaluationMode.CODE_FRAGMENT); checkExpression(expressionsByFirstId.get(1), "0", null, "custom info", EvaluationMode.EXPRESSION); List<XExpression> expressionsBySecondId = manager.getRecentExpressions("id2"); assertEquals(1, expressionsBySecondId.size()); checkExpression(expressionsBySecondId.get(0), "10", null, null, EvaluationMode.EXPRESSION); List<XExpression> expressionsByThirdId = manager.getRecentExpressions("id3"); assertTrue(expressionsByThirdId.isEmpty()); }