### Question:
SourceServicesImpl implements SourceServices { @Override public boolean hasServiceFor( final Path path ) { try { final SourceService sourceService = getMatchingSourceService( path ); return sourceService != null; } 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 testSomethingSimple() throws Exception { addToList(getSourceService(".drl")); assertTrue(new SourceServicesImpl(instance).hasServiceFor(makePath("myFile", ".drl"))); }
@Test public void testMissing() throws Exception { addToList(getSourceService(".notHere")); assertFalse(new SourceServicesImpl(instance).hasServiceFor(makePath("myFile", ".drl"))); }