List<String> () { final int itemsCount = myModel.getSize(); List<String> history = new ArrayList<>(itemsCount); for (int i = 0; i < itemsCount; i++) { history.add((String)myModel.getElementAt(i)); } return history; }