1
2
3
4
5
6 package net.sf.beanrunner.factory.impl;
7
8
9 import java.util.*;
10
11 import net.sf.beanrunner.factory.InstanceFactory;
12
13 public class StringInstanceFactory
14 implements InstanceFactory
15 {
16
17 public StringInstanceFactory(int size)
18 {
19 set = new HashSet();
20 set.add(null);
21 set.add("");
22 set.add("mama");
23 byte bytes[] = new byte[size];
24 (new Random(0L)).nextBytes(bytes);
25 String string = new String(bytes);
26 set.add(string);
27 }
28
29 public Iterator iterator()
30 {
31 return set.iterator();
32 }
33
34 Set set;
35 }