From 9de8a4a4367e527aba62feadc594fd1c68dc94dc Mon Sep 17 00:00:00 2001 From: eugenp Date: Tue, 26 Jan 2016 12:02:21 +0200 Subject: [PATCH] minor cleanup --- .../main/java/com/baeldung/doublecolon/Computer.java | 2 +- .../java/com/baeldung/doublecolon/MacbookPro.java | 11 +++++------ .../com/baeldung/doublecolon/TestComputerUtils.java | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java b/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java index 9535740309..b5d2e70abd 100644 --- a/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java +++ b/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java @@ -53,7 +53,7 @@ public class Computer { } public Double calculateValue(Double initialValue) { - return initialValue/1.50; + return initialValue / 1.50; } @Override diff --git a/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java b/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java index 673429132a..3fc459c681 100644 --- a/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java +++ b/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java @@ -2,8 +2,7 @@ package com.baeldung.doublecolon; import java.util.function.Function; - -public class MacbookPro extends Computer{ +public class MacbookPro extends Computer { public MacbookPro(int age, String color) { super(age, color); @@ -24,12 +23,12 @@ public class MacbookPro extends Computer{ } @Override - public Double calculateValue(Double initialValue){ + public Double calculateValue(Double initialValue) { - Function function = super::calculateValue; + Function function = super::calculateValue; final Double pcValue = function.apply(initialValue); - System.out.println("First value is:" +pcValue); - return pcValue + (initialValue/10) ; + System.out.println("First value is:" + pcValue); + return pcValue + (initialValue / 10); } } diff --git a/core-java-8/src/test/java/com/baeldung/doublecolon/TestComputerUtils.java b/core-java-8/src/test/java/com/baeldung/doublecolon/TestComputerUtils.java index 06cf1cf749..5ae6f02a56 100644 --- a/core-java-8/src/test/java/com/baeldung/doublecolon/TestComputerUtils.java +++ b/core-java-8/src/test/java/com/baeldung/doublecolon/TestComputerUtils.java @@ -80,10 +80,10 @@ public class TestComputerUtils { public void testSuperMethodReference() { final TriFunction integerStringIntegerObjectTriFunction = MacbookPro::new; - final MacbookPro macbookPro = integerStringIntegerObjectTriFunction.apply(2010, "black",100); - Double initialValue=new Double(999.99); + final MacbookPro macbookPro = integerStringIntegerObjectTriFunction.apply(2010, "black", 100); + Double initialValue = new Double(999.99); final Double actualValue = macbookPro.calculateValue(initialValue); - Assert.assertEquals(766.659, actualValue,0.0); + Assert.assertEquals(766.659, actualValue, 0.0); } }