Created
May 20, 2018 15:14
-
-
Save ThanawatMas/f908aa8b87b7f5cf756309a90a81c6e3 to your computer and use it in GitHub Desktop.
SolveByJava8RemoveIf.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SolveByJava8RemoveIf extends ConcurrentModificationSolution { | |
@Override | |
public void addItemAndReIndex(List<String> roundList, String newItem) { | |
roundList.removeIf(item -> item.equals(newItem)); | |
roundList.add(0, newItem); | |
} | |
@Override | |
public String solutionName() { | |
return "Java8 RemoveIf"; | |
} | |
public static void main(String[] args) { | |
SolveByJava8RemoveIf java8RemoveIf = new SolveByJava8RemoveIf(); | |
java8RemoveIf.solve(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment