### Question:
QuickbarModuleButtonsProvider { public List<ModuleButton> buttons() { Set<Module> collected = new LinkedHashSet<>(); fillWithMostRecentlyUsed(collected); fillWithMostUsed(collected); fillWithPrioritized(collected); return collected.stream().map(ModuleButton::new).collect(Collectors.toList()); } @Inject  QuickbarModuleButtonsProvider(UsageService service, List<Module> modules); List<ModuleButton> buttons();  }### Answer:
@Test public void mostUsedOnTop() { when(service.getMostUsed()).thenReturn(Arrays.asList(lowPrio)); when(service.getMostRecentlyUsed()).thenReturn(Arrays.asList(defaultPrio)); assertEquals(defaultPrio.id(), victim.buttons().stream().findFirst().get().moduleId()); }
@Test public void recentlyUsedOnTop() { when(service.getMostRecentlyUsed()).thenReturn(new ArrayList<>()); when(service.getMostUsed()).thenReturn(Arrays.asList(lowPrio)); assertEquals(lowPrio.id(), victim.buttons().stream().findFirst().get().moduleId()); }
@Test public void prioritizedUsedOnTop() { when(service.getMostUsed()).thenReturn(new ArrayList<>()); when(service.getMostRecentlyUsed()).thenReturn(new ArrayList<>()); assertEquals(highPrio.id(), victim.buttons().stream().findFirst().get().moduleId()); }