@Test public void modulesWithSamePriorityGetSortedByName() throws Exception { LockModule aModule = new AModule(); LockModule bModule = new BModule(); LockModule cModule = new CModule(); this.moduleList.add(bModule); this.moduleList.add(aModule); this.moduleList.add(cModule); List<LockModule> expectedList = Arrays.asList( aModule, bModule, cModule); List<LockModule> actualList = this.mocker.getComponentUnderTest().get(); Assert.assertThat(actualList, is(expectedList)); }
@Override public List<LockModule> get() { try { List<LockModule> services = new LinkedList<>(); services.addAll(this.componentManager.<LockModule>getInstanceList(LockModule.class)); Collections.sort(services, LockModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up lock modules", ex); } }
LockModuleListProvider implements Provider<List<LockModule>> { @Override public List<LockModule> get() { try { List<LockModule> services = new LinkedList<>(); services.addAll(this.componentManager.<LockModule>getInstanceList(LockModule.class)); Collections.sort(services, LockModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up lock modules", ex); } } }
LockModuleListProvider implements Provider<List<LockModule>> { @Override public List<LockModule> get() { try { List<LockModule> services = new LinkedList<>(); services.addAll(this.componentManager.<LockModule>getInstanceList(LockModule.class)); Collections.sort(services, LockModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up lock modules", ex); } }  }
LockModuleListProvider implements Provider<List<LockModule>> { @Override public List<LockModule> get() { try { List<LockModule> services = new LinkedList<>(); services.addAll(this.componentManager.<LockModule>getInstanceList(LockModule.class)); Collections.sort(services, LockModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up lock modules", ex); } }  @Override List<LockModule> get(); }
LockModuleListProvider implements Provider<List<LockModule>> { @Override public List<LockModule> get() { try { List<LockModule> services = new LinkedList<>(); services.addAll(this.componentManager.<LockModule>getInstanceList(LockModule.class)); Collections.sort(services, LockModuleComparator.INSTANCE); return services; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up lock modules", ex); } }  @Override List<LockModule> get();  }