@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 return_empty_if_component_is_not_file() {
    Component c = mock(Component.class);
    when(c.getType()).thenReturn(Type.DIRECTORY);
    assertThat(underTest.getScmInfo(c)).isEmpty();
  }