<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ivan Marrêta on Medium]]></title>
        <description><![CDATA[Stories by Ivan Marrêta on Medium]]></description>
        <link>https://medium.com/@ivanmarreta?source=rss-ff63ab4cc054------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*0PwYLoLVEfVhJ-QQgYR-ww.jpeg</url>
            <title>Stories by Ivan Marrêta on Medium</title>
            <link>https://medium.com/@ivanmarreta?source=rss-ff63ab4cc054------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 22 May 2026 13:48:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ivanmarreta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Diferença entre os patterns: Observer x Publish Subscribe]]></title>
            <link>https://medium.com/@ivanmarreta/diferen%C3%A7a-entre-os-patterns-observer-x-publish-subscribe-d2ec3c69850b?source=rss-ff63ab4cc054------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2ec3c69850b</guid>
            <category><![CDATA[pub-sub]]></category>
            <category><![CDATA[observer-pattern]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[programing]]></category>
            <dc:creator><![CDATA[Ivan Marrêta]]></dc:creator>
            <pubDate>Mon, 17 Aug 2020 16:42:17 GMT</pubDate>
            <atom:updated>2020-08-17T16:42:17.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j1CrTzAMBygeE9AG.jpg" /></figure><p>Adoro conversar, se tem uma coisa que gosto de fazer é falar e ouvir… e em uma dessas conversas recentes surgiu a discussão sobre como explicar mais rapidamente as diferenças entre os padrões de Observables e PubSub.</p><p>Resolvi então traduzir o fio da conversa em um post aqui, não vou entrar em todos os detalhes, mas apenas tentar ser mais lúcido e prático nas definições.</p><p>Então vamos lá!</p><h3>Observer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*vQzwN8HPP95e1ozp.png" /></figure><p>O padrão <strong>Observer</strong> é um <strong>padrão de design comportamental</strong> em que um objeto, chamado de <strong>Subject,</strong> permite definir uma ou mais inscrições dos chamados <strong>Observers, </strong>e os notifica automaticamente sobre quaisquer mudanças de estado, geralmente chamando um de seus métodos.</p><p>Vamos a um exemplo do mundo real:</p><blockquote>Você trabalha como vendedor em uma loja de calçados, porém a loja está sempre cheia e todos os dias anota diversos contatos por itens que estão em falta em um bloquinho. No dia seguinte ao verificar que um dos calçados já encontra-se em estoque e claro, para não perder sua comissão de venda, resolve ligar para todos todos os contatos do dia específico de procura daquele item que mudou de status.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*jB_E9eRWokokGonJV6kv0A.png" /><figcaption>Ilustração do exemplo do vendedor.</figcaption></figure><p>Agora o exemplo como deve ser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*jqgrU9hvnPwXGZCZBhVhJw.png" /><figcaption>Observer Design Pattern</figcaption></figure><p>Simples né? :)</p><h3>Publish Subscriber</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/0*oYZraPIl15kBSqg9" /></figure><p>É um padrão para troca de menssagens onde quem as envia são chamados de <strong>Publishers</strong>, porém eles não enviam as mensagens diretamente para quem os recebe, os<strong> Subscribers.</strong></p><p>Os publishers não tem conhecimento dos subscribers, e vice versa.. mas então como eles se comunicam? Eles expressam interesses(intents) de envios, e interesses em recepções.</p><p>Mas se eles não se conhecem, como é feita a comunicação? Há outro componente, o <strong>Message Broker</strong>, e ele sim é conhecido tanto pelo publisher quanto pelo subscriber. O publish enviará a mensagem ao message broker e ele por sua vez filtrará e transmitirá a mensagem ao(s) subscriber(s) correto(s).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*Er0B6OLTAX3tNcRNREd7nA.png" /><figcaption>PubSub Pattern</figcaption></figure><p>Existem vários message brokers disponíveis, no exemplo ilustrativo a área em cinza seria a sua representação, lembrando que são bem mais complexos que isso, é claro.</p><h3>Obrigado</h3><p>O post foi curto e rápido como previsto, vejo vocês em breve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2ec3c69850b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QuarkusIO — Supersonic Subatomic Java]]></title>
            <link>https://medium.com/@ivanmarreta/quarkusio-supersonic-subatomic-java-a2f894c2d718?source=rss-ff63ab4cc054------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2f894c2d718</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[quarkus]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Ivan Marrêta]]></dc:creator>
            <pubDate>Thu, 03 Oct 2019 21:18:17 GMT</pubDate>
            <atom:updated>2019-10-04T08:27:21.747Z</atom:updated>
            <content:encoded><![CDATA[<h3>QuarkusIO — Supersonic Subatomic Java</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*Ykt4QYINzRMHPEsB.png" /></figure><p>Hoje vamos iniciar um tutorial para aprender um pouco como utilizar esse framework java nativo da <strong>RedHat</strong>, que espera se tornar a plataforma líder em ambientes Serverless e Kubernetes, além de oferecer aos desenvolvedores um modelo unificado de programação reativa e imperativa.</p><p>O QuarkusIO aproveita uma série de libs comuns para os desenvolvedores Java, e algumas delas estão muito no hype como a Eclipse MicroProfile, Kafka e Vert.x. A injeção de dependência na framework é baseada no CDI, permitindo que os desenvolvedores usem JPA/Hibernate, JAX-RS/RESTEasy e etc.</p><p>Baseado nos melhores padrões, baixo consumo de processamento e tempo de inicialização incrivelmente rápido, o Quarkus permite o uso do Java em ambientes serverless, suportando um ambiente responsivo e escalável.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*-Z3_g8O2OzgBG0Io.png" /><figcaption><a href="https://quarkus.io/">https://quarkus.io/</a></figcaption></figure><h4>1 — Nossa primeira aplicação</h4><p>A forma mais fácil e rápida de criar nossa primeira aplicação Quarkus seria via linha de comando utilizando o <strong>Maven</strong>.</p><pre><strong>mvn io.quarkus:quarkus-maven-plugin:0.13.1:create \<br> -DprojectGroupId=com.ivanmarreta.quarkus \<br> -DprojectArtifactId=quarkus-project \<br> -DclassName=”com.ivanmarreta.quarkus.SampleResource” \<br> -Dpath=”/sample”</strong></pre><p>Este comando irá gerar um esqueleto do projeto, com um resource chamado SampleResource e com um endpoint <strong>/sample</strong> exposto, configurações e Dockerfiles.<br>Sendo um projeto maven, agora basta fazer o importe para sua IDE favorita, a estrutura será similar a esta:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*sxzrkLmBjxM5B0VG6VYeSg.png" /><figcaption>Eu utilizo o Intellij IDEA</figcaption></figure><p>Na nossa classe <strong>SampleResource</strong> temos o seguinte código:</p><pre>@Path(“/sample”)<br><strong>public class</strong> SampleResource {</pre><pre>  @GET<br>  @Produces(MediaType.TEXT_PLAIN)<br>  <strong>public</strong> <strong>String</strong> hello() {<br>    return “hello”;<br>  }<br>}</pre><p>E para executar nossa aplicação basta executar no terminal o comando:</p><pre><strong>./mvnw compile quarkus:dev</strong></pre><p>Na primeira vez o maven irá efetuar o download dos artefatos necessários e logo a aplicação estará up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*IMjs-DECgLqb3D0b1naEmg.png" /><figcaption>Mac OSX terminal screenshot</figcaption></figure><p>Pronto! Sua primeira aplicação está UP!</p><p>Para acessar o endpoint exposto podes testar via browser ou, como gosto de testar, via terminal:</p><pre><strong>curl -w “\n” http://localhost:8080/sample</strong></pre><p>Obtemos o resultado esperado: a string “hello”. (clap clap clap)</p><h4>2 — Hot Reload</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*o_6GeNY2ig40b8Zp.png" /></figure><p>No modo de desenvolvimento (<strong>./mvn compile quarkus:dev</strong>), o Quarkus fornece um recurso de Hot Reload. Com isso, as alterações feitas nos arquivos Java ou nos arquivos de configuração serão compiladas automaticamente assim que o navegador for atualizado ou, uma request for efetuada. O recurso mais impressionante aqui é que não precisamos salvar nossos arquivos. Portanto, dependendo da sua preferência, podes achar isso bom ou ruim.</p><p>Agora vamos observar como o Hot Reload age!</p><p>Na nossa ide criaremos uma classe chamada SampleService:</p><pre>@ApplicationScoped<br><strong>public class</strong> SampleService {</pre><pre>  <strong>public</strong> <strong>String</strong> hello(String name) {<br>    <strong>return</strong> String.format(“Hello %s. This is your first QuarkusIO<br>                          sample!”, name);<br>  }<br>}</pre><p>E agora vamos injetar essa classe utilizando CDI no nosso resource, criando também um novo endpoint exposto:</p><pre>@Path(“/sample”)<br><strong>public class</strong> SampleResource {</pre><pre>  @Inject<br>  SampleService service;</pre><pre>  @GET<br>  @Produces(MediaType.TEXT_PLAIN)<br>  <strong>public</strong> <strong>String</strong> hello() {<br>    return “hello”;<br>  }</pre><pre>  @GET<br>  @Path(“/{name}”)<br>  <strong>public</strong> <strong>String</strong> hello(@PathParam(“name”) String name) {<br>    <strong>return</strong> service.hello(name);<br>  }<br>}</pre><p>E então executamos nossa requisição ao nosso novo endpoint:</p><pre><strong>curl -w “\n” </strong><a href="http://localhost:8080/sample/Ivan"><strong>http://localhost:8080/sample/Ivan</strong></a></pre><pre>Hello Ivan. This is your first QuarkusIO sample!</pre><p>Conforme mencionei, podemos também alterar arquivos de configuração.</p><p>Vamos adicionar ao arquivo <strong>application.properties</strong> a linha:</p><pre><strong>hello=Hello %s. This is your first QuarkusIO sample!</strong></pre><p>E em nossa classe de serviço <strong>SampleService</strong>, vamos injetar a propriedade utilizando a anotação <a href="http://twitter.com/ConfigProperty">@ConfigProperty</a> do <strong>Eclipse Microprofile.</strong></p><p>Nossa classe ficará simples como isso:</p><pre>@ApplicationScoped<br><strong>public class</strong> SampleService {</pre><pre>  @ConfigProperty(name = “hello”)<br>  <strong>private</strong> String hello;</pre><pre>  <strong>public String </strong>hello(String name) {<br>    <strong>return</strong> String.format(hello, name);<br>  }<br>}</pre><p>Basta repetir a request e verás que o resultado será o mesmo e, podes até brincar alterando a string adicionada ao <strong>application.properties</strong>.</p><h4>3 — Json no response dos Rest Services</h4><p>Agora vamos tornar as coisas um pouco mais divertidas e aumentar um pouco a <em>“dificuldade”</em>.</p><p>Vamos adicionar código para retornar uma lista de objetos do tipo <strong>Sample</strong>.</p><pre><strong>public class</strong> Sample {</pre><pre>  private int order;<br>  private String name;</pre><pre>  …<br>}</pre><p>Na nossa <strong>SampleService</strong>, adicionamos o método:</p><pre><strong>public List&lt;Sample&gt;</strong> list(){<br>   Sample sample1 = new Sample(1, “Nossa primeira aplicação”);<br>   Sample sample2 = new Sample(1, “Hot Reload”);<br>   Sample sample3 = new Sample(1, “Json no response dos Rest ...”);<br>   <strong>return</strong> Arrays.asList(sample1, sample2, sample3);<br>}</pre><p>E nossa classe <strong>SampleResource</strong>, agora completa, ficará assim:</p><pre><strong>package</strong> com.ivanmarreta;</pre><pre><strong>import</strong> javax.inject.Inject;<br><strong>import</strong> javax.ws.rs.*;<br><strong>import</strong> javax.ws.rs.core.MediaType;<br><strong>import</strong> javax.ws.rs.core.<strong>Response</strong>;</pre><pre>@Path(“/sample”)<br>@Produces(MediaType.APPLICATION_JSON)<br>@Consumes(MediaType.APPLICATION_JSON)<br><strong>public class </strong>SampleResource {</pre><pre>  @Inject<br>  SampleService service;</pre><pre>  @GET<br>  <strong>public String </strong>hello() {<br>     <strong>return</strong> “hello”;<br>  }</pre><pre>  @GET<br>  @Path(“/{name}”)<br>  <strong>public</strong> <strong>String</strong> hello(@PathParam(“name”) String name) {<br>     <strong>return</strong> service.hello(name);<br>  }</pre><pre>  @GET<br>  @Path(“/list”)<br>  <strong>public Response </strong>list() {<br>     <strong>return</strong> Response.ok(service.list()).build();<br>  }<br>}</pre><p>Ao executar a request:</p><pre><strong>curl -w “\n” http://localhost:8080/sample/list</strong></pre><p>Iremos receber a seguinte resposta:</p><pre>Could not find MessageBodyWriter for response object of type: java.util.Arrays$ArrayList of media type: application/json</pre><p>Mas não se preocupe, está correto. O que tem de errado então? Precisamos adicionar no <strong>pom.xml</strong> a seguinte dependencia:</p><pre>&lt;dependency&gt;<br> &lt;groupId&gt;io.quarkus&lt;/groupId&gt;<br> &lt;artifactId&gt;quarkus-resteasy-jsonb&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><p>JSON-B não é a única forma de desserialização, podes também utilizar o Jackson, depende da sua preferência.</p><p>Bom, após adicionar a dependência, enfim, devemos reiniciar a app no nosso terminal, pois o maven precisará adicionar bibliotecas ao projeto. Desta vez verá que em questão de milisegundos a aplicação é started. õ/</p><p>Agora podemos testar nossa request e verificar o resultado:</p><pre><strong>curl -w “\n” http://localhost:8080/sample/list</strong></pre><pre>[{“name”:”Nossa primeira aplicação”,”order”:1},{“name”:”Hot Reload”,”order”:1},{“name”:”Json Rest Services”,”order”:1}]</pre><p>Nossa, muito complicado não é? :)</p><h4>4 — Packaging da nossa aplicação</h4><p>Via terminal, executamos:</p><pre><strong>./mvnw package</strong></pre><p>Serão gerados 2 artefactos jar dentro da pasta target:</p><p>Jar executável com todas as dependencias: <br><strong>ivanmarreta-quarkus-project-1.0-SNAPSHOT-runner.jar</strong></p><p>Jar contendo classes e resources:<br><strong>ivanmarreta-quarkus-project-1.0-SNAPSHOT.jar</strong></p><p>Agora para executar sua aplicação basta rodar o jar:</p><pre><strong>java -jar target/ivanmarreta-quarkus-project-1.0-SNAPSHOT-runner.jar</strong></pre><p>:)</p><h4>5 — Conclusão</h4><p>Demonstramos aqui um pouco do Quarkus, e verificamos que é um ótimo framework para levar o Java de maneira mais eficaz à nuvem. Por exemplo, agora é possível imaginar Java no AWS Lambda ou outra plataforma Serverless. Além disso, o QuarkusIO é baseado em padrões como JPA e JAX/RS. Portanto, para desenvolvedores Java experientes, não existe uma barreira de curva de aprendizado.</p><p>No próximo post sobre o QuarkusIO iremos explorar recursos mais avançados! õ/</p><p>Espero ler o que acham sobre o framework nos comentários e debater sobre o assunto.</p><p>Obrigado :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2f894c2d718" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 8 — Just a little “explanation” 2]]></title>
            <link>https://medium.com/@ivanmarreta/java-8-just-a-little-explanation-2-da88ec7cf049?source=rss-ff63ab4cc054------2</link>
            <guid isPermaLink="false">https://medium.com/p/da88ec7cf049</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[news]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ivan Marrêta]]></dc:creator>
            <pubDate>Wed, 29 Mar 2017 08:05:53 GMT</pubDate>
            <atom:updated>2017-03-29T08:05:53.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zu5Xg0aGpDXgGaE0-4pDig.jpeg" /></figure><p>In the <a href="https://medium.com/@ivanmarreta/java-8-just-a-little-hands-on-1-93576dbe18f8">first article</a> of this sequence you saw a new method on our <strong><em>List</em></strong>, the <strong><em>forEach</em></strong>. But, until Java 7 this method didn’t existed… how did it happen?</p><p>We know that if this method would be declared in an interface, we could have a big problem!<br>What?</p><p>Everyone who implemented the interface would need to implement it.<br>Chaos would be installed, work would be immense, the Java community would go insane.<br>An interface like <strong><em>List </em></strong>would destroy libraries used by most of us, such as <strong>Hibernate</strong>.</p><blockquote>Would be welcome to “<strong>NoSuchMethodErrors</strong>” Hell!</blockquote><p>BUT … we get a new feature in <strong>Java 8</strong>!</p><h3><strong>Default Methods</strong></h3><p>With this feature we can add a method to an interface and ensure that all implementations have it implemented. :)</p><p>For example, the forEach method we use is declared inside <strong><em>java.lang.Iterable</em></strong>, which is the parent of <strong><em>Collection</em></strong>, in turn List’s parent.</p><p>If we look at the method in the interface we’ll find:</p><pre>default void forEach(Consumer &lt;? Super T&gt; action) {<br>   Objects.requireNonNull (action);<br>   for (T t: this) {<br>      action.accept (t);<br>   }<br>}</pre><p>Yes, I think you never expected that, method with code inside interfaces..</p><p>As <strong><em>ArrayList</em></strong> implements <strong><em>List</em></strong>, which is (indirect) daughter of Iterable,<br>The <strong><em>ArrayList </em></strong>has this method, whether it wants to or not. It is for this reason that we can do it:</p><pre>books.forEach(b -&gt; System.out.println(b.getName()));</pre><p>This reading serves as an explanation for the <a href="https://medium.com/@ivanmarreta/java-8-just-a-little-hands-on-1-93576dbe18f8">first article</a>, which used this <strong><em>new feature</em></strong>.</p><p>Bye bye, see you!</p><p>References:<br><a href="https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html">https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da88ec7cf049" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 8 — Just a little “hands on” 1]]></title>
            <link>https://medium.com/@ivanmarreta/java-8-just-a-little-hands-on-1-93576dbe18f8?source=rss-ff63ab4cc054------2</link>
            <guid isPermaLink="false">https://medium.com/p/93576dbe18f8</guid>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[news]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ivan Marrêta]]></dc:creator>
            <pubDate>Fri, 17 Mar 2017 17:19:30 GMT</pubDate>
            <atom:updated>2017-03-17T17:19:30.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glUyflKnooLJsJRALtHOjA.jpeg" /></figure><p>I’m looking around and seeing many people working with older versions of Java.. then i will write some articles to estimulate this upgrade, to take doubts or discussions.</p><p>Let’s start in my first Medium article with a common practice.. a loop with FOR EACH.</p><p>Below you will take the old foreach:</p><pre><br>List&lt;Book&gt; books = Arrays.asList(book1, book2, book3);</pre><pre>for(Book u : books){<br>   System.out.println(b.getName());<br>}</pre><blockquote><strong>Arrays.asList</strong> is a easy way to create an immutable List.</blockquote><p>Now we can do for eachs with the new method of collections, forEach:</p><pre>books.forEach(…);</pre><p>This method receive a type <strong>java.util.function.Consumer</strong> with a unique method accept. This is from the <strong><em>new</em></strong> package <strong>java.util.function</strong>.</p><p>Let’s create this consumer, before use the new forEach:</p><pre>class Display implements Consumer&lt;Book&gt; {<br>    public void accept(Book b){<br>      System.out.println(b.getName());<br>    }<br>}</pre><p>Then we can do it:</p><pre>Display display = new Display();<br>usuarios.forEach(display);</pre><p>But, for this we can use anonymous classes like a good practice to simple tasks like that:</p><pre>Consumer&lt;Book&gt; display = new Consumer&lt;Book&gt;() {<br>   public void accept(Book b){<br>      System.out.println(b.getName());<br>   }<br>};</pre><pre>books.forEach(display);</pre><p>Now it’s better! But, the code is still bigger, let’s change one more time:</p><pre>books.forEach(new Consumer&lt;Book&gt;() {<br>   public void accept(Book b){<br>     System.out.println(b.getName());<br>   }<br>});</pre><p>Yeah! Now we have the same, but not so verbose..</p><h3>Hello, LAMBDA!</h3><p>Now let’s know the lambda, this is it the Java simple way to implements an interface with <strong>ONLY ONE</strong> method. (Remember what we talk about the <strong>java.util.function.Consumer</strong>) :)</p><pre>Consumer&lt;Book&gt; display = (Book b) -&gt; System.out.println(b.getName());};</pre><p>WTF?! yes.. this is the same forEach! :D</p><pre><br><strong>(Book b) -&gt; {System.out.println(b.getName());};</strong> </pre><pre>it’s a Java 8 lambda.</pre><p>The compiler knows how to infer the type, and if the block have only one instruction we can remove the { }.</p><pre>Consumer&lt;Book&gt; display = b -&gt; System.out.println(b.getName());</pre><p>What? A foreach on 1 line? Better… we don’t need a temporary variable.</p><pre>books.forEach(b -&gt; System.out.println(b.getName()));</pre><p>It’s this.</p><p>Easy? EASY and CLEAN.</p><p>I will continue more explanations about Java 8, if you have any idea to share, tell me.<br>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93576dbe18f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>