@Test public void registering_null_target_throws_illegal_argument_exception() { expected.expect(IllegalArgumentException.class); registryToTest.register(null); }
public void register(Target target) { notNull(target, "target may not be null!"); TargetType type = target.getType(); notNull(type, "target type may not be null!"); List<Target> list = getListFor(type); list.add(target); }
TargetRegistry { public void register(Target target) { notNull(target, "target may not be null!"); TargetType type = target.getType(); notNull(type, "target type may not be null!"); List<Target> list = getListFor(type); list.add(target); } }
TargetRegistry { public void register(Target target) { notNull(target, "target may not be null!"); TargetType type = target.getType(); notNull(type, "target type may not be null!"); List<Target> list = getListFor(type); list.add(target); } TargetRegistry(); }
TargetRegistry { public void register(Target target) { notNull(target, "target may not be null!"); TargetType type = target.getType(); notNull(type, "target type may not be null!"); List<Target> list = getListFor(type); list.add(target); } TargetRegistry(); void register(Target target); TargetRegistryInfo createRegistryInfo(TargetType type); List<Target> getTargetsFor(TargetType type); }
TargetRegistry { public void register(Target target) { notNull(target, "target may not be null!"); TargetType type = target.getType(); notNull(type, "target type may not be null!"); List<Target> list = getListFor(type); list.add(target); } TargetRegistry(); void register(Target target); TargetRegistryInfo createRegistryInfo(TargetType type); List<Target> getTargetsFor(TargetType type);  }