private static Set < Key > conditionToKeys ( int keyLength , Map < String , Set < Object > > condition ) { return crossProduct ( new ArrayList <> ( condition . values ( ) ) ) . stream ( ) . map ( v -> Keys . key ( keyLength , v . toArray ( ) ) ) . collect ( Collectors . toSet ( ) ) ; }
Set of objects is used for OR conditions . Otherwise set contains only one value .