@Test public void testEquals() { FileInfo info = mock(FileInfo.class); Muxer muxer = mock(Muxer.class); MuxedFile muxedFile = new MuxedFile(info, muxer); MuxedFile muxedFile2 = new MuxedFile(info, muxer); assertThat(muxedFile).isEqualTo(muxedFile); assertThat(muxedFile).isEqualTo(muxedFile2); assertThat(muxedFile).isNotEqualTo(null); assertThat(muxedFile).isNotEqualTo(info); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MuxedFile other = (MuxedFile) obj; return Objects.equals(info, other.info) && Objects.equals(muxer, other.muxer); }
MuxedFile { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MuxedFile other = (MuxedFile) obj; return Objects.equals(info, other.info) && Objects.equals(muxer, other.muxer); } }
MuxedFile { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MuxedFile other = (MuxedFile) obj; return Objects.equals(info, other.info) && Objects.equals(muxer, other.muxer); } MuxedFile(FileInfo info, Muxer muxer); }
MuxedFile { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MuxedFile other = (MuxedFile) obj; return Objects.equals(info, other.info) && Objects.equals(muxer, other.muxer); } MuxedFile(FileInfo info, Muxer muxer); FileInfo getInfo(); Muxer getMuxer(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
MuxedFile { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MuxedFile other = (MuxedFile) obj; return Objects.equals(info, other.info) && Objects.equals(muxer, other.muxer); } MuxedFile(FileInfo info, Muxer muxer); FileInfo getInfo(); Muxer getMuxer(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }