Java class to generate a random string of characters

I am blogging this because I keep losing it and want it to come up in google exactly like this next time I search for it. You are welcome to use it and charge millions of dollars for it (or not) if someone will pay it. If you need something cryptographically
random this is not it. It will generate first/last names suitable for obscuring the real first/last name for test data purposes (for instance).

import java.util.Random;

/**
 * This is a simple generator for random strings.  This is used mainly for unit tests where a unique alphabetical string (such as a human's name)
 * is required.  
 * 
 * @author acoliver at osintegrators.com
 */
public class RandomStringGenerator {
	public final static short TYPE_MIXED_CASE = 0;
	public final static short TYPE_UPPER_ONLY = 1;
	public final static short TYPE_LOWER_ONLY = 2;
	public final static Random rnd = new Random();
	
	static final char[] alphas = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
			         			  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	
	/**
	 * Generate a random string of characters at the specified length.  The first argument (type) is a constant 
	 * TYPE_MIXED_CASE, TYPE_UPPER_ONLY, TYPE_LOWER_ONLY.  This is followed by length.  That is followed by whether or not
	 * the first character should be capitalized (regardless of lower only).  It is of course silly to use initial caps
	 * with TYPE_UPPER_ONLY.  
	 * 
	 * @param type
	 * @param length
	 * @param initialCaps
	 * @return
	 */
	public static String generateRandomString(short type,int length, boolean initialCaps) {
		int min = type == TYPE_LOWER_ONLY ? 26 : 0;
		int max = type == TYPE_UPPER_ONLY ? 26 : alphas.length;
		String generated = "";
		for (int i = 0; i < length; i++) {			
			int random = rnd.nextInt(max - min) + min;
			generated += alphas[random];
		}
		generated = initialCaps ? (""+generated.charAt(0)).toUpperCase() + generated.substring(1) : generated;
		return generated;
	}

	/**
	 * Generate a random string of characters at the specified length without the option of initial caps.  See the other method in this class.
	 * @param type
	 * @param length
	 * @return
	 */
	public static String generateRandomString(short type,int length) {
		return generateRandomString(type, length, false);
	}
}

This is the unit test for it. Do not attempt to verify that the mixed case strings contain mixed characters. What I mean by mixed case is that both upper and lower case characters may be used not that they will be.

import org.junit.Test;

import yourpackagenameforit.RandomStringGenerator;

public class RandomStringGeneratorTest {

	@Test
	public void testGenerateRandomStringShortInt() {
		String fivecharLower = RandomStringGenerator.generateRandomString(RandomStringGenerator.TYPE_LOWER_ONLY, 5);
		System.out.println(fivecharLower);
		String fivecharUpper = RandomStringGenerator.generateRandomString(RandomStringGenerator.TYPE_UPPER_ONLY, 5);
		System.out.println(fivecharUpper);
		String fivecharMixed = RandomStringGenerator.generateRandomString(RandomStringGenerator.TYPE_MIXED_CASE, 5);
		System.out.println(fivecharMixed);
		assertNotNull("fivecharLower must not be null", fivecharLower);
		assertTrue("lower case test fivecharLower "+fivecharLower,fivecharLower.toLowerCase().equals(fivecharLower));
		assertEquals("5 chars in length fivecharLower "+fivecharLower, 5, fivecharLower.length());

		assertNotNull("fivecharUpper must not be null", fivecharUpper);
		assertTrue("lower case test fivecharUpper "+fivecharUpper,fivecharUpper.toUpperCase().equals(fivecharUpper));
		assertEquals("5 chars in length fivecharUpper "+fivecharUpper, 5, fivecharUpper.length());

		assertNotNull("fivecharMixed must not be null", fivecharMixed);
		assertEquals("5 chars in length fivecharMixed "+fivecharMixed, 5, fivecharMixed.length());		
	}

	@Test
	public void testGenerateRandomStringShortIntBoolean() {
		String fivecharLower = RandomStringGenerator.generateRandomString(RandomStringGenerator.TYPE_LOWER_ONLY, 5, true);
		assertNotNull("fivecharLower must not be null", fivecharLower);
		assertTrue("lower case test (except initial) fivecharLower "+fivecharLower,fivecharLower.substring(1).toLowerCase().equals(fivecharLower.substring(1)));
		assertTrue("initial caps test "+fivecharLower.charAt(0), (""+fivecharLower.charAt(0)).toUpperCase().equals(""+fivecharLower.charAt(0)));
		assertEquals("5 chars in length fivecharLower "+fivecharLower, 5, fivecharLower.length());
		
	}

}

PS yes I am aware that there are several implementations of this available. I dislike them.