test_class.declarator: directory
test_class.modifier: private
test_class.original_string: private AggregateRootDirectory directory;
test_class.type: AggregateRootDirectory
test_class.var_name: directory
test_class.declarator: repository
test_class.modifier: private
test_class.original_string: private AggregatePartRepository<?, ?, ?> repository;
test_class.type: AggregatePartRepository<?, ?, ?>
test_class.var_name: repository
test_class.file: server/src/test/java/io/spine/server/aggregate/InMemoryRootDirectoryTest.java
test_class.identifier: InMemoryRootDirectoryTest
test_case.body: @Test
      @DisplayName("not find a non-registered repository")
      void notFindRepository() {
          Optional<? extends AggregatePartRepository<?, ?, ?>> found =
                  directory.findPart(TaskRoot.class, AggTask.class);
          OptionalSubject assertRepository = assertThat(found);
          assertRepository.isEmpty();
      }
test_case.class_method_signature: InMemoryRootDirectoryTest.notFindRepository()
test_case.full_signature: @Test @DisplayName("not find a non-registered repository") void notFindRepository()
test_case.identifier: notFindRepository
test_case.invocations: findPart assertThat isEmpty
test_case.modifiers: @Test @DisplayName("not find a non-registered repository")
test_case.parameters: ()
test_case.return: void
test_case.signature: void notFindRepository()
focal_class.declarator: repositories = synchronizedSetMultimap(HashMultimap.create())
focal_class.modifier: private final
focal_class.original_string: private final SetMultimap<Class<? extends AggregateRoot<?>>, AggregatePartRepository<?, ?, ?>>
      repositories = synchronizedSetMultimap(HashMultimap.create());
focal_class.type: SetMultimap<Class<? extends AggregateRoot<?>>, AggregatePartRepository<?, ?, ?>>
focal_class.var_name: repositories
focal_class.file: server/src/main/java/io/spine/server/aggregate/InMemoryRootDirectory.java
focal_class.identifier: InMemoryRootDirectory
focal_class.interfaces: implements AggregateRootDirectory
focal_class.class_method_signature: InMemoryRootDirectory.register(AggregatePartRepository<?, ?, ?> repository)
focal_class.full_signature: @Override public void register(AggregatePartRepository<?, ?, ?> repository)
focal_class.identifier: register
focal_class.modifiers: @Override public
focal_class.parameters: (AggregatePartRepository<?, ?, ?> repository)
focal_class.return: void
focal_class.signature: void register(AggregatePartRepository<?, ?, ?> repository)
focal_class.class_method_signature: InMemoryRootDirectory.findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_class.full_signature: @Override public Optional<? extends AggregatePartRepository<?, ?, ?>> findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_class.identifier: findPart
focal_class.modifiers: @Override public
focal_class.parameters: (Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_class.return: Optional<? extends AggregatePartRepository<?, ?, ?>>
focal_class.signature: Optional<? extends AggregatePartRepository<?, ?, ?>> findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_method.body: @Override
      public Optional<? extends AggregatePartRepository<?, ?, ?>>
      findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass) {
          Set<AggregatePartRepository<?, ?, ?>> parts = repositories.get(rootClass);
          if (parts.isEmpty()) {
              return Optional.empty();
          } else {
              TypeUrl targetType = TypeUrl.of(partStateClass);
              Optional<AggregatePartRepository<?, ?, ?>> repository = parts
                      .stream()
                      .filter(repo -> repo.entityStateType().equals(targetType))
                      .findAny();
              return repository;
          }
      }
focal_method.class_method_signature: InMemoryRootDirectory.findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_method.full_signature: @Override public Optional<? extends AggregatePartRepository<?, ?, ?>> findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_method.identifier: findPart
focal_method.invocations: get isEmpty empty of findAny filter stream equals entityStateType
focal_method.modifiers: @Override public
focal_method.parameters: (Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)
focal_method.return: Optional<? extends AggregatePartRepository<?, ?, ?>>
focal_method.signature: Optional<? extends AggregatePartRepository<?, ?, ?>> findPart(Class<? extends AggregateRoot<?>> rootClass,
               Class<? extends EntityState> partStateClass)