rdafbn.blogspot.com
Remove duplications and fix bad names: Even in the jdk there is bad code.
http://rdafbn.blogspot.com/2013/04/even-in-jdk-there-is-bad-code.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Sunday, 28 April 2013. Even in the jdk there is bad code. Java 7, TreeSet and NullPointerException. Recently I tried to compile with java 7 a project developed with java 6. So, I had to understand why and this is what I discovered. Note that the field "name" is nullable=false. In java 7 when the f...
rdafbn.blogspot.com
Remove duplications and fix bad names: Simple benchmarking : Immutable Collections VS Persistent Collections
http://rdafbn.blogspot.com/2015/05/simple-benchmarking-immutable.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Thursday, 14 May 2015. Simple benchmarking : Immutable Collections VS Persistent Collections. Often you need to add new elements to a collection. You can create immutable collections using the guava. Library and also using the recent pCollection. They both will contain 10.000 integers initially.
rdafbn.blogspot.com
Remove duplications and fix bad names: July 2015
http://rdafbn.blogspot.com/2015_07_01_archive.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Wednesday, 8 July 2015. CompletableFuture can be a complex concept if taken by itself, so I will use a simple example here to show for one business requirement, how to use it, when to use it and what is the difference comparing to parallelStream. The requirement is as follows :. Pizza Discount : ".
rdafbn.blogspot.com
Remove duplications and fix bad names: Java 8 and how Optional removes the need for == null
http://rdafbn.blogspot.com/2015/06/java-8-and-how-optional-remove-null.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Tuesday, 16 June 2015. Java 8 and how Optional removes the need for = null. I was confused initially when the Optional concept entered the Java world. I was wondering how the hell can Optional remove the need to check for null? INFO: some info here 1". INFO: some info here 2". Me on the web. Be ab...
rdafbn.blogspot.com
Remove duplications and fix bad names: Chain of responsibility using Spring @Autowired List
http://rdafbn.blogspot.com/2012/11/chain-of-responsibility-using-spring.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Thursday, 15 November 2012. Chain of responsibility using Spring @Autowired List. There is a way in Spring 3.1 to auto populate a typed List which is very handy when you want to push a bit the decoupling and the cleaning in your code. Let start from the (only) domain class we have, the User:.
rdafbn.blogspot.com
Remove duplications and fix bad names: June 2015
http://rdafbn.blogspot.com/2015_06_01_archive.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Thursday, 25 June 2015. Strategy Pattern in Java 8. These are two examples on how to implement a Strategy pattern design. Using Java 8 functional style together with Cyclops pattern matching. AddPrefix is another strategy that will add a prefix to a message based on the message content. In this ex...
rdafbn.blogspot.com
Remove duplications and fix bad names: Step Builder pattern
http://rdafbn.blogspot.com/2012/07/step-builder-pattern_28.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Saturday, 28 July 2012. Recently I wanted to implement a builder in my Grep4j. API, but, as already happened in the past with the builder or other creational patterns, I was not completely satisfied with the result. A Builder pattern. So far so good. All the above panino instances are wrong, and t...
rdafbn.blogspot.com
Remove duplications and fix bad names: JUnit4 Parameterized and Theories
http://rdafbn.blogspot.com/2012/11/junit4-parameterized-and-theories.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Thursday, 8 November 2012. JUnit4 Parameterized and Theories. I always relied on TestNG to pass parameters to test methods in order to give a bit of flexibility to my tests or suites. However, the same flexibility can be achieved using JUnit4. To use it it’s simple:. Package com.marco.test;. Priva...
rdafbn.blogspot.com
Remove duplications and fix bad names: Testing Spring components with Mockito
http://rdafbn.blogspot.com/2014/01/testing-spring-components-with-mockito.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Wednesday, 15 January 2014. Testing Spring components with Mockito. A way to achieve this goal is to use Mockito. And tell him to replace the @Autowired components in the class you want to test, with Mocks ( or Spies ). Run select for employeeId;. Some other weird calculation . Now, we want to uni...
rdafbn.blogspot.com
Remove duplications and fix bad names: A simple way to test distributed applications
http://rdafbn.blogspot.com/2012/08/testing-distributed-applications.html
Remove duplications and fix bad names. New ideas pass through three periods:. 1) It can’t be done. 2) It probably can be done, but it’s not worth doing. 3) I knew it was a good idea all along! Arthur C. Clarke. Thursday, 2 August 2012. A simple way to test distributed applications. So, testing distributed applications is not easy, we all know it. Too many variants to take in considerations which usually lead to an high instability of the tests. What if I want to keep my tests. My solution is in the logs.