This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> stringList = Arrays.asList("a", "b", "c", "ddd"); | |
int result = stringList.stream().reduce(0, (acc, element ) -> acc + element.length(),(c1, c2) -> c1 + c2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.klkl | |
import groovy.transform.CompileStatic | |
import spock.lang.Specification | |
class GroovySpreadOperatorTest extends Specification { | |
interface Service { | |
List<Integer> heavyOperation() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace view feedback_mentor as | |
with mentor_rating as (select | |
mentor_id, | |
count(fe.mentor_id) as RATING_COUNT, | |
avg(fe.answer::integer) as AVG_SCORE, | |
string_agg(fe.answer , ',') as SCORES, | |
string_agg('"' || fe.comment || '"' , ';') as COMMENTS | |
from | |
feedback fe | |
where |