@Test public void testFileRequestHashCode() { final URI sourcePrime = URI.create("http: final URI targetPrime = URI.create("http: final URI sourceSecondary = URI.create("http: final FileRequest first = FileRequestFactory.create(sourcePrime, targetPrime); final FileRequest second = FileRequestFactory.create(sourceSecondary, targetPrime); assertThat(first.hashCode()).isNotEqualTo(second.hashCode()); final FileRequest firstDup = FileRequestFactory.create(first.getSourceFile(), first.getTargetFile()); assertThat(firstDup.hashCode()).isEqualTo(first.hashCode()); }
public static FileRequest create(final URI sourceFile, final URI targetFile) { if (sourceFile == null) { throw new NullPointerException("Source file cannot be null."); } if (targetFile == null) { throw new NullPointerException("Target file cannot be null."); } return new FileRequestImpl(sourceFile, targetFile); }
FileRequestFactory { public static FileRequest create(final URI sourceFile, final URI targetFile) { if (sourceFile == null) { throw new NullPointerException("Source file cannot be null."); } if (targetFile == null) { throw new NullPointerException("Target file cannot be null."); } return new FileRequestImpl(sourceFile, targetFile); } }
FileRequestFactory { public static FileRequest create(final URI sourceFile, final URI targetFile) { if (sourceFile == null) { throw new NullPointerException("Source file cannot be null."); } if (targetFile == null) { throw new NullPointerException("Target file cannot be null."); } return new FileRequestImpl(sourceFile, targetFile); }  }
FileRequestFactory { public static FileRequest create(final URI sourceFile, final URI targetFile) { if (sourceFile == null) { throw new NullPointerException("Source file cannot be null."); } if (targetFile == null) { throw new NullPointerException("Target file cannot be null."); } return new FileRequestImpl(sourceFile, targetFile); }  static FileRequest create(final URI sourceFile, final URI targetFile); }
FileRequestFactory { public static FileRequest create(final URI sourceFile, final URI targetFile) { if (sourceFile == null) { throw new NullPointerException("Source file cannot be null."); } if (targetFile == null) { throw new NullPointerException("Target file cannot be null."); } return new FileRequestImpl(sourceFile, targetFile); }  static FileRequest create(final URI sourceFile, final URI targetFile);  }