### Question:
JpaApplicationDataRepository implements ApplicationDataRepository { @Override @Transactional public JpaApplicationData save(ApplicationData item) { JpaApplicationData jpaAppData = converter.convert(item); JpaSerializableApplicationData jpaSerializableApplicationData = getJpaSerializableApplicationData(jpaAppData); jpaSerializableApplicationData.serializeData(); return saveOrUpdate(jpaSerializableApplicationData.getEntityId(), manager, jpaSerializableApplicationData); }  @Override Class<? extends ApplicationData> getType(); @Override ApplicationData get(String id); @Override @Transactional JpaApplicationData save(ApplicationData item); @Override void delete(ApplicationData item); @Override List<ApplicationData> getAll(); @Override List<ApplicationData> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override List<ApplicationData> getApplicationData(List<String> userIds, String appId); @Override JpaApplicationData getApplicationData(String personId, String appId);  }### Answer:
@Test @Transactional @Rollback(true) public void save_newEntity() { ApplicationData applicationData = new JpaApplicationData(null, VALID_USER_ID, SECOND_VALID_APPLICATION_ID, validApplicationDataMap); JpaApplicationData saved = (JpaApplicationData)repository.save(applicationData); manager.flush(); assertThat(saved.getEntityId(), is(notNullValue())); }
@Test @Transactional @Rollback(true) public void save_existingEntity() { JpaApplicationData applicationData = new JpaApplicationData(VALID_APPLICATION_DATA_ID, VALID_USER_ID, VALID_APPLICATION_ID, new HashMap<String, Object>()); JpaApplicationData saved = (JpaApplicationData)repository.save(applicationData); manager.flush(); assertThat(saved, is(not(sameInstance(applicationData)))); assertThat(saved.getEntityId(), is(equalTo(applicationData.getEntityId()))); }