import org.junit.jupiter.api.Test;import src.strategy.Cache;import src.strategy.StrategyFIFO;import src.strategy.StrategyLFU;import src.strategy.StrategyLRU;import src.template.Computer;import src.template.GamingComputer;import src.template.OfficeComputer;import src.template.ProgrammingComputer;import java.io.FileNotFoundException;import java.util.Arrays;import java.util.Collections;import java.util.Comparator;/*** @author: chenbihao* @create: 2021年9月6日* @Description:* @History:*/public class StrategyTest {@Testpublic void test() {Cache cache = new Cache();cache.add("添加");cache.add("缓存");cache.add("数据");cache.setEvictionStrategy(new StrategyFIFO());cache.get();cache.evict();cache.evict();cache.setEvictionStrategy(new StrategyLRU());cache.evict();cache.setEvictionStrategy(new StrategyLFU());cache.evict();}public void asd(){// new Comparator();// Collections.sort();// Arrays.sort()}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。