@Override
  public List<DefaultIssue> getIssues(Component component) {
    if (component.getType() == Component.Type.DIRECTORY) {
      // No issues on directories
      return Collections.emptyList();
    }
    checkState(this.component != null && this.issues != null, "Issues have not been initialized");
    checkArgument(component.equals(this.component),
      "Only issues from component '%s' are available, but wanted component is '%s'.",
      this.component.getReportAttributes().getRef(), component.getReportAttributes().getRef());
    return issues;
  }
@Test
  public void fail_with_ISE_when_getting_issues_but_issues_are_null() {
    assertThatThrownBy(() -> {
      sut.getIssues(FILE_1);
    })
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Issues have not been initialized");
  }