Skip to content

Instantly share code, notes, and snippets.

View holograph's full-sized avatar

Tomer Gabel holograph

View GitHub Profile
@holograph
holograph / A.java
Created October 14, 2018 08:48
Showcasing Java method references
import java.util.function.Supplier;
class A {
static int staticSupplier() { return 5; }
int instanceSupplier() { return 10; }
static void printOut(Supplier<Integer> supplier) {
System.out.println(supplier.get());
}
@holograph
holograph / Stateful.scala
Created March 4, 2020 17:56
Accord example showing stateful validators
package com.wix.accord.examples
class Stateful(allowedNames: Set[String]) {
import com.wix.accord.dsl._
import com.wix.accord._
private implicit val classroomValidator = validator[Classroom] { c =>
c.teacher.name is in(allowedNames)
c.students.map(_.name).each is in(allowedNames)