public Map < String , List < Object > > collectAttributesFromEntity ( final JsonObject couchbaseEntity , final Predicate < String > filter ) { return couchbaseEntity . getNames ( ) . stream ( ) . filter ( filter ) . map ( name -> Pair . of ( name , couchbaseEntity . get ( name ) ) ) . collect ( Collectors . toMap ( Pair :: getKey , s -> CollectionUtils . wrapList ( s . getValue ( ) ) ) ) ; }
Collect attributes from entity map .