Fixed code according to PMD test. (java-basic, java-design, java-unusedcode).