public void testVMID() throws Exception
{
HashSet repositoryIDs = new HashSet();
System.out.println();
System.out.println("---------------------- testProveVMIDHashCodeIsSame");
VMID guid = null;
Method method = VMID.class.getDeclaredMethod("create", new Class[]{});
method.setAccessible(true);
for (int i = 0; i < ITERATIONS; i++)
{
guid = (VMID) method.invoke(null, new Object[]{});
Integer hashKey = new Integer(guid.hashCode());
if (!repositoryIDs.contains(hashKey))
{
repositoryIDs.add(hashKey);
}
System.out.println("guid.hashCode()=" + guid.hashCode());
}
if (repositoryIDs.size()==1)
{
fail("HashCode is always returning the same hash");