@Test public void testInvalidWeight() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("weight must be positive"); Weighted.create(-1); }
public static Weighted create(int weight) { return new Weighted(weight); }
Weighted { public static Weighted create(int weight) { return new Weighted(weight); } }
Weighted { public static Weighted create(int weight) { return new Weighted(weight); } private  Weighted(int weight); }
Weighted { public static Weighted create(int weight) { return new Weighted(weight); } private  Weighted(int weight); static Weighted create(int weight); int weight(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
Weighted { public static Weighted create(int weight) { return new Weighted(weight); } private  Weighted(int weight); static Weighted create(int weight); int weight(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }