if (algorithmName == null) {
algorithm = new LRU(cacheSize);
} else if (algorithmName.equals("LRU")) {
algorithm = new LRU(cacheSize);
} else if (algorithmName.equals("FIFO")) {
algorithm = new FIFO(cacheSize);
} else {
throw new IllegalArgumentException("unknown replacement algorithm: " + algorithmName);
}
}
this.name = name;