Skip to content

Commit

Permalink
Changed name from Sorter to ListUtil
Browse files Browse the repository at this point in the history
Added ListUtil.containsString
  • Loading branch information
Fernthedev committed Jan 29, 2020
1 parent 14d3b92 commit 5af8057
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -5,9 +5,13 @@

import java.util.*;

public class Sorter {
public class ListUtil {

public static List<DateObject> sortNewest(HashMap<Date,Object> oldList) {
public static boolean containsString(List<String> strings, String string) {
return strings.parallelStream().anyMatch(s -> s.equals(string));
}

public static List<DateObject> sortNewest(Map<Date,Object> oldList) {

List<DateObject> dateObjects = new ArrayList<>();

Expand All @@ -23,7 +27,7 @@ public static List<DateObject> sortNewest(List<DateObject> oldList) {
return oldList;
}

public static List<DateObject> sortOldest(HashMap<Date,Object> oldList) {
public static List<DateObject> sortOldest(Map<Date,Object> oldList) {

List<DateObject> dateObjects = new ArrayList<>();

Expand Down

0 comments on commit 5af8057

Please sign in to comment.