String symbol = symbols[i];
table.findSymbol(symbol.toCharArray(), 0, symbol.length(), symbol.hashCode());
}
}
SymbolTable table = new SymbolTable();
for (int i = 0; i < symbols.length; ++i) {
String symbol = symbols[i];
char[] charArray = symbol.toCharArray();
table.addSymbol(charArray, 0, charArray.length);
//System.out.println((table.hash(symbol) & table.getIndexMask()) + "\t\t:" + symbol + "\t\t" + table.hash(symbol));
}
String symbol = "name";
table.addSymbol(symbol.toCharArray(), 0, symbol.length());
table.addSymbol(symbol.toCharArray(), 0, symbol.length());
Assert.assertTrue(symbol == table.addSymbol("name".toCharArray(), 0, 4));
Assert.assertTrue(symbol == table.addSymbol(" name".toCharArray(), 1, 4));
Assert.assertTrue(symbol == table.addSymbol(" name ".toCharArray(), 1, 4));
Assert.assertTrue(symbol != table.addSymbol(" namf ".toCharArray(), 1, 4));
}