@Test public void testHashCode() { assertEquals(movie1.hashCode(), movie1.hashCode()); assertEquals(movie1.hashCode(), movie7.hashCode()); assertTrue(movie1.hashCode() != "abc".hashCode()); assertTrue(movie1.hashCode() != movie2.hashCode()); assertTrue(movie1.hashCode() != movie3.hashCode()); assertTrue(movie1.hashCode() != movie4.hashCode()); assertTrue(movie1.hashCode() != movie5.hashCode()); assertTrue(movie1.hashCode() != movie6.hashCode()); }
@Override public int hashCode() { int result = 17; int c = 0; c = ((name == null) ? 0 : name.hashCode()); result = 37 * result + c; c = (int) year; result = 37 * result + c; c = ((genre == null) ? 0 : genre.hashCode()); result = 37 * result + c; return result; }
Movie implements Serializable { @Override public int hashCode() { int result = 17; int c = 0; c = ((name == null) ? 0 : name.hashCode()); result = 37 * result + c; c = (int) year; result = 37 * result + c; c = ((genre == null) ? 0 : genre.hashCode()); result = 37 * result + c; return result; } }
Movie implements Serializable { @Override public int hashCode() { int result = 17; int c = 0; c = ((name == null) ? 0 : name.hashCode()); result = 37 * result + c; c = (int) year; result = 37 * result + c; c = ((genre == null) ? 0 : genre.hashCode()); result = 37 * result + c; return result; } Movie();  Movie(String name, short year, String fileExtension);  Movie(String name, short year, String genre, long filesize,
			String fileExtension); }
Movie implements Serializable { @Override public int hashCode() { int result = 17; int c = 0; c = ((name == null) ? 0 : name.hashCode()); result = 37 * result + c; c = (int) year; result = 37 * result + c; c = ((genre == null) ? 0 : genre.hashCode()); result = 37 * result + c; return result; } Movie();  Movie(String name, short year, String fileExtension);  Movie(String name, short year, String genre, long filesize,
			String fileExtension); String getName(); void setName(String name); short getYear(); void setYear(short year); String getGenre(); void setGenre(String genre); long getFilesize(); void setFilesize(long filesize); String getFileExtension(); void setFileExtension(String fileExtension); String getParent(); void setParent(String parent); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
Movie implements Serializable { @Override public int hashCode() { int result = 17; int c = 0; c = ((name == null) ? 0 : name.hashCode()); result = 37 * result + c; c = (int) year; result = 37 * result + c; c = ((genre == null) ? 0 : genre.hashCode()); result = 37 * result + c; return result; } Movie();  Movie(String name, short year, String fileExtension);  Movie(String name, short year, String genre, long filesize,
			String fileExtension); String getName(); void setName(String name); short getYear(); void setYear(short year); String getGenre(); void setGenre(String genre); long getFilesize(); void setFilesize(long filesize); String getFileExtension(); void setFileExtension(String fileExtension); String getParent(); void setParent(String parent); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); static final short UNKNOWN_RELEASE_YEAR; static final String UNKNOWN_GENRE; }