Friday 10 August 2018

Can I use a Stream multiple times?

Just a quick question, that I answered using a small unit test.

Stream<String> stream = Arrays.asList("John""Paul""Ringo""George").stream();
assertThat(stream.filter(x -> x.equals("Matthias")).collect(Collectors.toList())).hasSize(0);
assertThat(stream.count()).isEqualTo(4);

Does this work?

Answer in my next blog.

Thursday 2 August 2018

Dialogue

So, on route to the train station, the following conversation took place between me and my two colleagues:

Colleague 1: Another day in software design, where nothing is as it seems.
Me: If nothing is as it seems, you probably violated every naming convention known to man.
Colleague 2: Clean code!! Uncle Bob would be proud!