// An ordinary (identity) record. No value classes anywhere in this file. import java.util.List; record Node(String label, List edges) { static void nullCheck(Object arg, Object owner) { if (arg == null) throw new IllegalArgumentException("null arg for " + owner); } public Node { nullCheck(label, this); nullCheck(edges, this); } }