Currently, after the map operation, you have a Stream<List<String>> and you're trying to compare that with a String, hence will never yield the expected outcome.
Now, to the solution; from what I can gather it seems that you want to retain the entire line if the TIMESTAMP and RESPONSETIME are valid integers.
One way to go about this is:
List<String> rows = br.lines()
.skip(1) // skip headers
.map(s -> new AbstractMap.SimpleEntry<>(s,s.split(DILIMETER)))
.filter(a -> isInteger(a.getValue()[0]) && isInteger(a.getValue()[2]))
.map(AbstractMap.SimpleEntry::getKey)
.collect(Collectors.toList());
and the isInteger function being defined as follows:
public static boolean isInteger(String input)
{
if(input == null || input.trim().isEmpty()) return false;
for (char c : input.toCharArray())
if (!Character.isDigit(c)) return false;
return true;
}
Another solution being is if you want to retrieve a List<String[]> where each array represents the individual data of each line then you can do:
List<String[]> rows = br.lines()
.skip(1) // skip headers
.map(s -> s.split(DILIMETER))
.filter(a -> isInteger(a[0]) && isInteger(a[2]))
.collect(Collectors.toList());
Note, if the file being read only contains the data with no headers then there is no need to perform the skip operation.
ArrayListthen you use.filter(a -> a.equals("TIMESTAMP"))which is not logicArrayListis not aStringno?br.lines().forEach(System.out::println)