CollisionDJBX33X implements CollisionInterface { @Override public void genNCollisions( int n, StringBuilder sb, boolean useNamespace ) { try { InputStream is = getClass().getResourceAsStream( "/DJBX33XCollisions/DJBX33XCollisions.txt" ); BufferedReader br = new BufferedReader( new InputStreamReader( is ) ); String prefix = ""; if ( useNamespace == true ) { prefix = "xmlns:"; } String strLine; sb.append( "" ); long k = 0; while ( k < n && ( strLine = br.readLine() ) != null ) { sb.append( prefix + strLine + "=\"" + k + "\" " ); k++; } br.close(); } catch ( Exception e ) { } }  @Override int getHash( String s ); int hashBack( String s, int target ); int hashForth( String s ); @Override void genNCollisions( int n, StringBuilder sb, boolean useNamespace ); @Override String getCollisionString( int i, int n ); String getRandomString( int length ); String getIthNCharString( int i, int n ); int generateCollionsMeetInTheMiddle( long numberCollisions );  }
@Test public void testGenNCollisions() { System.out.println( "Test genNCollisions-DJBX33X - 4 elements" ); int numberAttributes = 4; StringBuilder sb = new StringBuilder(); CollisionDJBX33X instance = new CollisionDJBX33X(); instance.genNCollisions( numberAttributes, sb, false ); if ( sb.toString().length() > 0 ) { assertTrue( true ); } else { assertTrue( false ); } }