Hi,
the class Account didnt implement the equals() and hashCode() methods. Therefore the Set cannot determine that an object is in or not.
Problem
boolean isAccountInCache = app.getAccounts().join().contains(myAccount);
This is not working because of the missing methods. As a Workaround, we have to iterate trough every element in this cache. Which make this library very inefficient and latency expensive.
Problematic Workaround
boolean isAccountInCache = app.getAccounts().join().stream().anymatch( acc -> acc.username().equals(myusername));
This is working well for ~100 accounts in the cache, but in larger applications with more than 10-100k users in cache this will be a problem. Imagine we iterate for every request 10k times through this accounts set.
Maybe I find time to open a PR and/or provide a PoC of this problem.
Best regards
Max