@Test public void testEquality() { LibraryVersion testee1 = new LibraryVersion("10.0.1-1234"); LibraryVersion testee2 = new LibraryVersion(10, 0, 1, 1234); assertTrue(testee1.equals(testee2)); assertEquals(testee1, testee2); assertFalse(new LibraryVersion("10.1.1-1234").equals(new LibraryVersion(10, 1, 1, 123))); assertFalse(new LibraryVersion("10.1.1-1234").equals(new LibraryVersion(10, 1, 1))); assertEquals(new LibraryVersion("10.0.1-1234"), "10.0.1-1234"); }
public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } LibraryVersion(String version);  LibraryVersion(int major, int minor, int sub, int build);  LibraryVersion(int major, int minor, int sub);  LibraryVersion(int major, int minor);  LibraryVersion(int major); }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } LibraryVersion(String version);  LibraryVersion(int major, int minor, int sub, int build);  LibraryVersion(int major, int minor, int sub);  LibraryVersion(int major, int minor);  LibraryVersion(int major); boolean equals(LibraryVersion v); @Override boolean equals(Object o); @Override int hashCode(); int getMinor(); int getMajor(); int getSub(); int getBuild(); @Override String toString(); }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } LibraryVersion(String version);  LibraryVersion(int major, int minor, int sub, int build);  LibraryVersion(int major, int minor, int sub);  LibraryVersion(int major, int minor);  LibraryVersion(int major); boolean equals(LibraryVersion v); @Override boolean equals(Object o); @Override int hashCode(); int getMinor(); int getMajor(); int getSub(); int getBuild(); @Override String toString();  }