### Question:
JpaActivityStreamsObjectConverter implements ModelConverter<ActivityStreamsObject, JpaActivityStreamsObject> { @Override public JpaActivityStreamsObject convert(ActivityStreamsObject source) { if(source != null && source.getId() == null) { source.setId(UUID.randomUUID().toString()); } return source instanceof JpaActivityStreamsObject ? (JpaActivityStreamsObject) source : createEntity(source); }  @Override JpaActivityStreamsObject convert(ActivityStreamsObject source); @Override Class<ActivityStreamsObject> getSourceType();  }### Answer:
@Test public void testNoConversion() { JpaActivityStreamsObject template = new JpaActivityStreamsObject(); assertThat(converter.convert(template), is(sameInstance(template))); }
@Test public void nullConversion() { ActivityStreamsObject template = null; assertThat(converter.convert(template), is(nullValue())); }
@Test public void convertValid() { ActivityStreamsObject template = new ActivityStreamsObjectImpl(); template.setContent("TEST_A"); template.setDisplayName("TEST_B"); template.setDc("TEST_C"); template.setLd("TEST_D"); template.setDc("TEST_E"); template.setMood("TEST_F"); template.setLocation("TEST_G"); template.setRating("TEST_H"); template.setSource("TEST_I"); template.setLinks("TEST_J"); JpaActivityStreamsObject jpaTemplate = converter.convert(template); assertThat(jpaTemplate, is(not(sameInstance(template)))); assertThat(jpaTemplate, is(instanceOf(JpaActivityStreamsObject.class))); assertThat(jpaTemplate.getContent(), is(equalTo(template.getContent()))); assertThat(jpaTemplate.getDisplayName(), is(equalTo(template.getDisplayName()))); assertThat(jpaTemplate.getContent(), is(equalTo(template.getContent()))); assertThat(jpaTemplate.getDc(), is(equalTo(template.getDc()))); assertThat(jpaTemplate.getMood(), is(equalTo(template.getMood()))); assertThat(jpaTemplate.getLocation(), is(equalTo(template.getLocation()))); assertThat(jpaTemplate.getRating(), is(equalTo(template.getRating()))); assertThat(jpaTemplate.getSource(), is(equalTo(template.getSource()))); assertThat(jpaTemplate.getLinks(), is(equalTo(template.getLinks()))); }