@Override
  public void register(Component component) {
    checkComponent(component);
    checkArgument(component.getType() == Component.Type.FILE, "component must be a file");
    checkState(analysisMetadataHolder.isPullRequest() || !analysisMetadataHolder.isFirstAnalysis(), "No file can be registered on first branch analysis");

    addedComponents.add(component);
  }
@Test
  public void register_fails_with_NPE_if_component_is_null() {
    assertThatThrownBy(() -> underTest.register(null))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("component can't be null");
  }