ServiceLoader code fixes
added tests for serviceloader