### Question:
ConfigurationSubscriptionService extends PersistenceService<ConfigurationSubscription, ConfigurationSubscriptionDto, Long> { public ConfigurationSubscriptionQuery createQuery() { return new ConfigurationSubscriptionQueryImpl(createEntityManager(), subscriptionMapper); } ConfigurationSubscriptionService(EntityManagerFactory entityManagerFactory, ConfigurationSubscriptionMapper subscriptionMapper); ConfigurationSubscriptionQuery createQuery();  }### Answer:
@Test void testAdd() { configurationSubscriptionService.add(CONFIGURATION_SUBSCRIPTION_1); assertEquals(1, configurationSubscriptionService.createQuery() .list() .size()); assertEquals(CONFIGURATION_SUBSCRIPTION_1.getId(), configurationSubscriptionService.createQuery() .id(CONFIGURATION_SUBSCRIPTION_1.getId()) .singleResult() .getId()); }
@Test void testAddWithNonEmptyDatabase() { addConfigurationSubscriptions(List.of(CONFIGURATION_SUBSCRIPTION_1, CONFIGURATION_SUBSCRIPTION_2)); assertConfigurationSubscriptionExists(CONFIGURATION_SUBSCRIPTION_1.getId()); assertConfigurationSubscriptionExists(CONFIGURATION_SUBSCRIPTION_2.getId()); assertEquals(2, configurationSubscriptionService.createQuery() .list() .size()); }
@Test void testQueryByFilterMatching() { addConfigurationSubscriptions(List.of(CONFIGURATION_SUBSCRIPTION_1, CONFIGURATION_SUBSCRIPTION_2)); int foundSubscriptions = configurationSubscriptionService.createQuery() .onSelectMatching(Collections.singletonList(new ConfigurationEntry(null, null, Version.parseVersion("3.1"), "default", null, null, null, null, null))) .list() .size(); assertEquals(1, foundSubscriptions); }