public void load(ScannerReport.Metadata metadata) {
    if (delegate != null) {
      delegate.load(metadata);
    } else if (hasBranchProperties(metadata)) {
      throw MessageException.of("Current edition does not support branch feature");
    } else {
      metadataHolder.setBranch(new DefaultBranchImpl(defaultBranchNameResolver.getEffectiveMainBranchName()));
    }
  }
@Test
  public void throw_ME_if_both_delegate_absent_and_has_branch_parameters() {
    ScannerReport.Metadata metadata = ScannerReport.Metadata.newBuilder()
      .setBranchName("bar")
      .build();

    assertThatThrownBy(() -> new BranchLoader(metadataHolder, mock(DefaultBranchNameResolver.class)).load(metadata))
      .isInstanceOf(MessageException.class)
      .hasMessage("Current edition does not support branch feature");
  }