if (cacheSize <= 0) {
throw new IllegalArgumentException("cacheSize must be larger than 0");
} else {
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);
}