NetworkStrategy implements ReplicationStrategy { public NetworkStrategy with(String datacenter, int replicationFactor) { notNullOrEmpty(datacenter, "datacenter"); if (replicationFactor < 1) { throw new IllegalArgumentException("Replication Factor must be greater than zero"); } dataCenters.put(datacenter, replicationFactor); return this; }  @Override String getName(); @Override String createCqlStatement(); NetworkStrategy with(String datacenter, int replicationFactor); Map<String, Integer> getDataCenters();  }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionWhenReplicatonFactorLessThenOneGiven() { new NetworkStrategy().with("EAST", -1); }