Skip to content

Instantly share code, notes, and snippets.

@ThanawatMas
Created May 20, 2018 15:14
Show Gist options
  • Save ThanawatMas/f908aa8b87b7f5cf756309a90a81c6e3 to your computer and use it in GitHub Desktop.
Save ThanawatMas/f908aa8b87b7f5cf756309a90a81c6e3 to your computer and use it in GitHub Desktop.
SolveByJava8RemoveIf.java
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