public void addWarning(Component file, LineReader.ReadError readError) {
    checkNotCommitted();
    requireNonNull(file, "file can't be null");
    requireNonNull(readError, "readError can't be null");

    fileErrorsPerData.compute(readError.data(), (data, existingList) -> {
      Set<Component> res = existingList == null ? new HashSet<>() : existingList;
      res.add(file);
      return res;
    });
  }
@Test
  public void addWarning_fails_with_NPE_if_readError_is_null() {
    Component component = mock(Component.class);

    assertThatThrownBy(() -> underTest.addWarning(component, null))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("readError can't be null");
  }