A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
  • Newsletters

deduplication

A collection of 1 posts
Deduplication trick in legacy code
Java

Deduplication trick in legacy code

It might happen that you need to deduplicate a list of items…​ coming from legacy code. The class - let’s call it LegacyObject has already implementations for equals() and hashCode(). It’s not possible to change the implementation, for fear of breaking the running code. And unfortunately, the Java API doesn’t offer a distinctBy() feature.

Mar 24, 2019
A Java geek © 2008-2026
v. 9744a65fcb2ff5057d025d26766c50d6f934fc0b/13747693232
Latest Posts