BAEL-4936: converted multiline code to one liner, also changed names of unit test methods

This commit is contained in:
Vikas Ramsingh Rajput
2021-06-11 19:55:03 +05:30
parent 596093f07f
commit 4aa72e6251
3 changed files with 5 additions and 13 deletions

View File

@@ -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() {

View File

@@ -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());
}
}