Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenp committed Jan 26, 2016
1 parent da40afe commit 9de8a4a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void turnOffPc() {
}

public Double calculateValue(Double initialValue) {
return initialValue/1.50;
return initialValue / 1.50;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import java.util.function.Function;


public class MacbookPro extends Computer{
public class MacbookPro extends Computer {

public MacbookPro(int age, String color) {
super(age, color);
Expand All @@ -24,12 +23,12 @@ public void turnOffPc() {
}

@Override
public Double calculateValue(Double initialValue){
public Double calculateValue(Double initialValue) {

Function<Double,Double> function = super::calculateValue;
Function<Double, Double> 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);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ public void testInstanceMethodArbitraryObjectParticularType() {
public void testSuperMethodReference() {

final TriFunction<Integer, String, Integer, MacbookPro> 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);
}

}

0 comments on commit 9de8a4a

Please sign in to comment.