FileDataSourceId implements CharSequence { @Override public boolean equals(Object obj) { return this == obj ? true : obj instanceof FileDataSourceId ? this.getFile().equals(((FileDataSourceId) obj).getFile()) : false; } private  FileDataSourceId(LinearIdBuilder id); static FileDataSourceId parse(CharSequence input); static FileDataSourceId parse(String input); static FileDataSourceId from(File file); T fill(T bean); String getFile(); String getFileName(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); static Parser<DataSource> legacyParser(final String providerName, final String version);  }
@Test public void testEquals() throws IOException { FileDataSourceId sourceId = FileDataSourceId.from(FILE); Assert.assertEquals(sourceId, FileDataSourceId.from(FILE)); Assert.assertNotSame(sourceId, FileDataSourceId.from(FILE)); Assert.assertFalse(sourceId.equals(FileDataSourceId.from(OTHER))); Assert.assertEquals(sourceId, FileDataSourceId.parse(FILE.getPath())); Assert.assertNotSame(sourceId, FileDataSourceId.parse(FILE.getPath())); Assert.assertFalse(sourceId.equals(FileDataSourceId.parse(OTHER.getPath()))); Assert.assertEquals(sourceId, FileDataSourceId.parse((CharSequence)sourceId)); Assert.assertSame(sourceId, FileDataSourceId.parse((CharSequence)sourceId)); }