CollisionDJBX33A implements CollisionInterface { @Override public void genNCollisions( int numberAttributes, StringBuilder sb, boolean useNamespace ) { try { String prefix = ""; final long startTime = System.nanoTime(); final long endTime; int exponent = 1; while ( numberAttributes > ( (int) Math.pow( 2, exponent ) ) ) { exponent++; } if ( useNamespace == true ) { prefix = "xmlns:"; } for ( int i = 0; i < numberAttributes; i++ ) { sb.append( prefix + getCollisionString( i, exponent ) + "=\"" + i + "\" " ); } endTime = System.nanoTime(); final long duration = endTime - startTime; double d = duration / 1000000000.0; } catch ( Exception e ) { } }  @Override int getHash( String s ); @Override void genNCollisions( int numberAttributes, StringBuilder sb, boolean useNamespace ); @Override String getCollisionString( int i, int n );  }
@Test public void testGenNCollisions() { System.out.println( "Test genNCollisions-DJBX33A" ); int numberAttributes = 32; StringBuilder sb = new StringBuilder(); CollisionDJBX33A instance = new CollisionDJBX33A(); instance.genNCollisions( numberAttributes, sb, false ); if ( sb.toString().length() > 0 ) { assertTrue( true ); } else { assertTrue( false ); } }