@Override
    public boolean equals(Object obj) {
        if (obj instanceof IndexFile) {
            if (equalsByExists((IndexFile) obj)) {
                if (this.exists()) {
                    return equalsByIsSameFile((IndexFile) obj);
                } else {
                    return Objects.equals(this.getAbsoluteFile().getAbsolutePath(), ((IndexFile)obj).getAbsoluteFile().getAbsolutePath());
                }
            }
            return false;
        }
        return false;
    }
@Test
    void isEqualExisting() {
        IndexFile compareFile = getFileByFilePath("./target/test-classes/IndexFile.test_json")
                .map(IndexFile::new)
                .orElseThrow(() -> new RuntimeException("Failed to retrieve IndexFile.test_json"));
        assertThat(compareFile.getName()).isEqualTo(testingFile.getName());
        assertThat(compareFile.getPath()).isNotEqualTo(testingFile.getPath());
        assertThat(compareFile.getAbsolutePath()).isNotEqualTo(testingFile.getAbsolutePath());
        assertThat(compareFile.equals(testingFile)).isTrue();
    }