Skip to content

Instantly share code, notes, and snippets.

View GuiSim's full-sized avatar
🐼

Guillaume Simard GuiSim

🐼
  • Tola
  • Québec
View GitHub Profile
List<String> rows = Files.readAllLines(Paths.get(fileName), StandardCharsets.UTF_8);
String header = rows.remove(0);
// You can then continue with your application logic
int headerColumnCount = header.split(Constants.SEPERATOR_ESCAPED).length;
for (String row : rows) {
System.out.println(row);
}
@GuiSim
GuiSim / LambdaMatcher.java
Created June 27, 2014 12:22
Hamcrest matcher that matches a Lambda.
import java.util.function.Function;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
public class LambdaMatcher<T> extends BaseMatcher<T>
{
private final Function<T, Boolean> matcher;
private final String description;