public interface SimulationSource {
ObjectReader OBJECT_READER = new ObjectMapper().readerFor(Simulation.class);
static SimulationSource url(final URL url) {
return () -> {
try {
<BUG>return Optional.of(OBJECT_READER.readValue(url));
} catch (IOException e) {</BUG>
throw new IllegalArgumentException("Cannot read simulation", e);
}
};

public interface SimulationSource {
ObjectReader OBJECT_READER = new ObjectMapper().readerFor(Simulation.class);
static SimulationSource url(final URL url) {
return () -> {
try {
return OBJECT_READER.readValue(url);
} catch (IOException e) {
throw new IllegalArgumentException("Cannot read simulation", e);
}
};
