MarkerConverter implements Converter<Marker> { @Override public Marker convertFrom(String value) { if (value == null) { throw new ParameterException("Couldn't convert value \"null\" to marker."); } return MarkerFactory.getMarker(value); }  @Override Marker convertFrom(String value); @Override String convertTo(Marker marker);  }
@Test public void convertFromValidString() throws Exception { assertEquals(MarkerFactory.getMarker("test"), new MarkerConverter().convertFrom("test")); }
@Test public void convertFromNull() throws Exception { expectedException.expect(ParameterException.class); expectedException.expectMessage("Couldn't convert value \"null\" to marker."); new MarkerConverter().convertFrom(null); }