for (int i = 0; i < nHosts; i++) {
String startToken = TokenGenerator.initialToken(nHosts, i, minInitialToken, maxInitialToken);
String endToken = TokenGenerator.initialToken(nHosts, i+1, minInitialToken, maxInitialToken);
if (endToken.equals(maxInitialToken.toString()))
endToken = minInitialToken.toString();
TokenRange range = new TokenRangeImpl(startToken, endToken, null);
for (int j = 0; j < replication_factor; j++) {
hosts.get((i+j)%nHosts).getTokenRanges().add(range);
}
}