package net.kencochrane.raven;

import org.hamcrest.Matchers;
import org.testng.annotations.Test;

import java.util.ServiceLoader;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;

public class DefaultRavenFactoryTest {
    @Test
    public void checkServiceLoaderProvidesFactory() {
        ServiceLoader<RavenFactory> ravenFactories = ServiceLoader.load(RavenFactory.class);

        assertThat(ravenFactories, Matchers.<RavenFactory>hasItem(instanceOf(DefaultRavenFactory.class)));
    }
}

package net.kencochrane.raven;

import org.testng.annotations.Test;

import java.util.ServiceLoader;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.instanceOf;

public class DefaultRavenFactoryTest {
    @Test
    public void checkServiceLoaderProvidesFactory(){
        ServiceLoader<RavenFactory> ravenFactories = ServiceLoader.load(RavenFactory.class);

        assertThat(ravenFactories, contains(instanceOf(DefaultRavenFactory.class)));
    }
}

--- 
+++ 
@@ -1,18 +1,18 @@
 package net.kencochrane.raven;
 
+import org.hamcrest.Matchers;
 import org.testng.annotations.Test;
 
 import java.util.ServiceLoader;
 
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.contains;
 import static org.hamcrest.Matchers.instanceOf;
 
 public class DefaultRavenFactoryTest {
     @Test
-    public void checkServiceLoaderProvidesFactory(){
+    public void checkServiceLoaderProvidesFactory() {
         ServiceLoader<RavenFactory> ravenFactories = ServiceLoader.load(RavenFactory.class);
 
-        assertThat(ravenFactories, contains(instanceOf(DefaultRavenFactory.class)));
+        assertThat(ravenFactories, Matchers.<RavenFactory>hasItem(instanceOf(DefaultRavenFactory.class)));
     }
 }
Use hasItem rather than contains
