### Question:
SourceServicesImpl implements SourceServices { @Override public SourceService getServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); if ( sourceService == null ) { throw new IllegalArgumentException( "No SourceService found for '" + path + "'." ); } return sourceService; } catch ( Exception e ) { throw ExceptionUtilities.handleException( e ); } } SourceServicesImpl(); @Inject  SourceServicesImpl( @Any Instance<SourceService<?>> sourceServiceList ); @Override boolean hasServiceFor( final Path path ); @Override SourceService getServiceFor( final Path path );  }### Answer:
@Test public void testShorter() throws Exception { SourceService DRL = getSourceService(".drl"); SourceService modelDRL = getSourceService(".model.drl"); addToList(DRL, modelDRL); assertEquals(DRL, new SourceServicesImpl(instance).getServiceFor(makePath("myFile", ".drl"))); sourceServices.clear(); addToList(modelDRL, DRL); assertEquals(DRL, new SourceServicesImpl(instance).getServiceFor(makePath("myFile", ".drl"))); }
@Test public void testLonger() throws Exception { SourceService DRL = getSourceService(".drl"); SourceService modelDRL = getSourceService(".model.drl"); addToList(DRL, modelDRL); assertEquals(modelDRL, new SourceServicesImpl(instance).getServiceFor(makePath("myFile", ".model.drl"))); sourceServices.clear(); addToList(modelDRL, DRL); assertEquals(modelDRL, new SourceServicesImpl(instance).getServiceFor(makePath("myFile", ".model.drl"))); }