### Question:
SpsAdapterFactory { public static SpsAdapter createAdapter(final String serviceUrl, final String version) throws MissingAdapterImplementationException { if (serviceUrl == null) { throw new IllegalArgumentException("Service URL must not be null."); } if (version == null) { throw new IllegalArgumentException("Service version must not be null."); } if (VERSION_100.equals(version)) { return new SpsAdapterV100(serviceUrl); } else { final String msg = "No adapter found for version '%s'."; throw new MissingAdapterImplementationException(format(msg, version)); } } private  SpsAdapterFactory(); static SpsAdapter createAdapter(final String serviceUrl, final String version);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionWhenPassedServiceUrlIsNull() throws Exception { createAdapter(null, null); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionWhenPassedVersionIsNull() throws Exception { createAdapter("http: }
@Test(expected = MissingAdapterImplementationException.class) public void shouldThrowExceptionWhenPassedVersionMatchesNoAdapterImplementation() throws Exception { createAdapter("http: }
@Test public void shouldCreateSpsAdapterWithVersion100() { final String version = "1.0.0"; try { final SpsAdapter adapter = createAdapter("http: assertThat(adapter.isSupporting(version), is(true)); } catch (final MissingAdapterImplementationException e) { fail("SpsAdapter with " + version + " could not be created"); } }