To βfixβ your code with the least changes, add the lambda parameter:
activePostedList.stream().collect(Collectors.toMap( ar -> AccountTransactionKey.createNewAccountTransactionKeyFromActivityReconcileRecord(ar)), o -> o));
or use the link to the method:
activePostedList.stream().collect(Collectors.toMap( AccountTransactionKey::createNewAccountTransactionKeyFromActivityReconcileRecord, o -> o));
btw, I canβt ever remember the look of the method name until createNewAccountTransactionKeyFromActivityReconcileRecord - for readability, consider reducing it to just create() , since the return type and parameter type are enough to distinguish it from another factory methods you may have.
Bohemian
source share