### Question:
DataCenterAwarePolicy implements ChainableLoadBalancingPolicy { public static Builder builder() { return new Builder(); } DataCenterAwarePolicy(String localDc, LoadBalancingPolicy childPolicy); static Builder builder(); @Override LoadBalancingPolicy getChildPolicy(); @Override void init(Cluster cluster, Collection<Host> hosts); @Override HostDistance distance(Host host); HostDistance distance(Host host, String dataCenter); @Override Iterator<Host> newQueryPlan(final String loggedKeyspace, final Statement statement); @Override void onUp(Host host); @Override void onDown(Host host); @Override void onAdd(Host host); @Override void onRemove(Host host); @Override void close();  }### Answer:
@Test public void testBuilderWithValidInput() { DataCenterAwarePolicy.builder().withChildPolicy(myChildPolicy).withLocalDc(myLocalDc).build(); }
@Test public void testBuilderWithChildPolicyAsNull() { LoadBalancingPolicy childPolicy = null; assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> DataCenterAwarePolicy.builder() .withChildPolicy(childPolicy) .withLocalDc(myLocalDc) .build()); }
@Test public void testBuilderWithLocalDcAsNull() { String localDc = null; assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> DataCenterAwarePolicy.builder() .withChildPolicy(myChildPolicy) .withLocalDc(localDc).build()); }