@Test(expected = IllegalArgumentException.class) public void setCapacityIllegalCapacity() { BoundedArchive archive = new BoundedArchive(10) { @Override protected boolean updateWithNondominated(Collection<Individual> candidates) { Assert.fail(); return false; } }; archive.setCapacity(-1); }
public void setCapacity(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Invalid capacity: " + capacity); } this.capacity = capacity; }
BoundedArchive extends AbstractArchive { public void setCapacity(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Invalid capacity: " + capacity); } this.capacity = capacity; } }
BoundedArchive extends AbstractArchive { public void setCapacity(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Invalid capacity: " + capacity); } this.capacity = capacity; } @Inject  BoundedArchive(int capacity); }
BoundedArchive extends AbstractArchive { public void setCapacity(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Invalid capacity: " + capacity); } this.capacity = capacity; } @Inject  BoundedArchive(int capacity); void setCapacity(int capacity); int getCapacity(); @Override boolean addCheckedIndividual(Individual individual); @Override boolean addCheckedIndividuals(Collection<? extends Individual> c); }
BoundedArchive extends AbstractArchive { public void setCapacity(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Invalid capacity: " + capacity); } this.capacity = capacity; } @Inject  BoundedArchive(int capacity); void setCapacity(int capacity); int getCapacity(); @Override boolean addCheckedIndividual(Individual individual); @Override boolean addCheckedIndividuals(Collection<? extends Individual> c);  }