### Question:
BatchWriterConfig implements Writable { public BatchWriterConfig setMaxWriteThreads(int maxWriteThreads) { if (maxWriteThreads <= 0) throw new IllegalArgumentException("Max threads must be positive " + maxWriteThreads); this.maxWriteThreads = maxWriteThreads; return this; }  BatchWriterConfig setMaxMemory(long maxMemory); BatchWriterConfig setMaxLatency(long maxLatency, TimeUnit timeUnit); BatchWriterConfig setTimeout(long timeout, TimeUnit timeUnit); BatchWriterConfig setMaxWriteThreads(int maxWriteThreads); long getMaxMemory(); long getMaxLatency(TimeUnit timeUnit); long getTimeout(TimeUnit timeUnit); int getMaxWriteThreads(); Durability getDurability(); BatchWriterConfig setDurability(Durability durability); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override boolean equals(Object o); BatchWriterConfig merge(BatchWriterConfig other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testZeroMaxWriteThreads() { BatchWriterConfig bwConfig = new BatchWriterConfig(); bwConfig.setMaxWriteThreads(0); }
@Test(expected = IllegalArgumentException.class) public void testNegativeMaxWriteThreads() { BatchWriterConfig bwConfig = new BatchWriterConfig(); bwConfig.setMaxWriteThreads(-1); }