### Question:
JpaRegionConverter implements ModelConverter<Region, JpaRegion> { @Override public JpaRegion convert(Region source) { return source instanceof JpaRegion ? (JpaRegion) source : createEntity(source); }  @Override Class<Region> getSourceType(); @Override JpaRegion convert(Region source);  }### Answer:
@Test public void noConversion() { Region region = new JpaRegion(); assertThat(regionConverter.convert(region), is(sameInstance(region))); }
@Test public void nullConversion() { Region template = null; assertThat(regionConverter.convert(template), is(nullValue())); }
@Test public void newRegion() { Region region = new RegionImpl("9"); region.setLocked(false); region.setPage(new JpaPage()); region.setRegionWidgets(new ArrayList<RegionWidget>()); region.setRenderOrder(9); JpaRegion converted = regionConverter.convert(region); assertThat(converted, is(not(sameInstance(region)))); assertThat(converted, is(instanceOf(JpaRegion.class))); assertThat(converted.getRegionWidgets(), is(equalTo(region.getRegionWidgets()))); assertThat(converted.getEntityId().toString(), is(equalTo(region.getId()))); assertThat(converted.getId(), is(equalTo(region.getId()))); assertThat(converted.getPage(), is(instanceOf(Page.class))); assertThat(converted.getRenderOrder(), is(equalTo(region.getRenderOrder()))); assertThat(converted.isLocked(), is(equalTo(region.isLocked()))); }