@Override
  public Optional<ScmInfo> getScmInfo(Component component) {
    requireNonNull(component, "Component cannot be null");

    if (component.getType() != Component.Type.FILE) {
      return Optional.empty();
    }

    return scmInfoCache.computeIfAbsent(component, this::getScmInfoForComponent);
  }
@Test
  public void read_from_DB_with_missing_lines_if_no_report_and_file_unchanged() {
    createDbScmInfoWithMissingLine();
    when(fileStatuses.isUnchanged(FILE_SAME)).thenReturn(true);

    // should clear revision and author
    ScmInfo scmInfo = underTest.getScmInfo(FILE_SAME).get();
    assertThat(scmInfo.getAllChangesets()).hasSize(2);
    assertChangeset(scmInfo.getChangesetForLine(1), null, null, 10L);
    assertThat(scmInfo.hasChangesetForLine(2)).isFalse();

    verify(fileStatuses).isUnchanged(FILE_SAME);
    verify(dbLoader).getScmInfo(FILE_SAME);

    verifyNoMoreInteractions(dbLoader);
    verifyNoMoreInteractions(fileStatuses);
    verifyNoInteractions(diff);
  }