BAEL-4936: converted multiline code to one liner, also changed names of unit test methods
This commit is contained in:
@@ -9,11 +9,7 @@ public abstract class CircleClass {
|
||||
private List<String> allowedColors = Arrays.asList("RED", "GREEN", "BLUE");
|
||||
|
||||
public boolean isValid() {
|
||||
if (allowedColors.contains(getColor())) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return allowedColors.contains(getColor());
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
|
||||
@@ -7,12 +7,8 @@ public interface CircleInterface {
|
||||
List<String> allowedColors = Arrays.asList("RED", "GREEN", "BLUE");
|
||||
|
||||
String getColor();
|
||||
|
||||
|
||||
public default boolean isValid() {
|
||||
if (allowedColors.contains(getColor())) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return allowedColors.contains(getColor());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user