void (@Nullable String statement) { if (StringUtil.isEmptyOrSpaces(statement)) return; synchronized (myLock) { int maxHistorySize = getMaxHistorySize(); myEntries.remove(statement); int size = myEntries.size(); if (size >= maxHistorySize && size > 0) { myEntries.removeFirst(); } myEntries.addLast(statement); incModificationCount(); } }