@Override
	public String toString() {

		String key = "    items: ";
		String newlinePad = StringUtils.repeat(' ', key.length());

		StringBuilder buffy = new StringBuilder();
		for (int i = 0; i < historyStack.size(); i++) {
			T t = historyStack.get(i);
			if (t == null) {
				continue; // the last item is permitted to be null
			}

			if (i == historyIndex) {
				buffy.append('[').append(t.toString()).append(']');
			}
			else {
				buffy.append(t.toString());
			}

			if (i != historyStack.size() - 1) {
				buffy.append(',').append('\n').append(newlinePad);
			}
		}

		//@formatter:off
		return "{\n" +
			key + buffy.toString() + "\n" + 
		"}";
		//@formatter:on				
	}
Returns the number of items in this history list

@return the number of items in this history list
Ghidra/Framework/Generic/src/main/java/util/HistoryList.java