@Override
  public FileAttributes getFileAttributes() {
    checkState(this.type == Component.Type.FILE, "Only component of type FILE have a FileAttributes object");
    return fileAttributes;
  }
@Test
  public void fail_with_ISE_when_calling_get_file_attributes_on_not_file() {
    assertThatThrownBy(() -> {
      ComponentImpl component = new ComponentImpl("Project", Component.Type.PROJECT, null);
      component.getFileAttributes();
    })
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Only component of type FILE have a FileAttributes object");
  }