RecordBasedRepository extends Repository<I, E> { @OverridingMethodsMustInvokeSuper @Override public E create(I id) { E result = entityFactory().create(id); return result; } protected  RecordBasedRepository(); @OverridingMethodsMustInvokeSuper @Override E create(I id); @Override void store(E entity); @Override Iterator<E> iterator(Predicate<E> filter); @SuppressWarnings("unchecked") // Checked at runtime. @Experimental final void applyMigration(I id, Migration<I, T, S> migration); @SuppressWarnings("unchecked") // Checked at runtime. @Experimental final void applyMigration(Set<I> ids, Migration<I, T, S> migration); void store(Collection<E> entities); @Override Optional<E> find(I id); Optional<E> findActive(I id); @VisibleForTesting Iterator<E> loadAll(ResponseFormat format); Iterator<E> loadAll(Iterable<I> ids, FieldMask fieldMask); @Internal Iterator<EntityRecord> loadAllRecords(ResponseFormat format); Iterator<E> find(TargetFilters filters, ResponseFormat format); @Internal Iterator<EntityRecord> findRecords(TargetFilters filters, ResponseFormat format);  }
@Test @DisplayName("create entities") void createEntities() { I id = createId(5); E projectEntity = repository().create(id); assertNotNull(projectEntity); assertEquals(id, projectEntity.id()); }