Here you can find the source of listOfStrings(int size, String prefix)
public static List<String> listOfStrings(int size, String prefix)
//package com.java2s; /*//from w ww .j a v a 2s .com * Copyright 2009 The Portico Project * * This file is part of pgauge (a sub-project of Portico). * * pgauge is free software; you can redistribute it and/or modify * it under the terms of the Common Developer and Distribution License (CDDL) * as published by Sun Microsystems. For more information see the LICENSE file. * * Use of this software is strictly AT YOUR OWN RISK!!! * If something bad happens you do not have permission to come crying to me. * (that goes for your lawyer as well) * */ import java.util.ArrayList; import java.util.List; public class Main { public static List<String> listOfStrings(int size, String prefix) { ArrayList<String> list = new ArrayList<String>(size); for (int i = 1; i <= size; i++) list.add(prefix + i); return list; } }