### Question:
ConfigSanityCheck { public static void validate(Iterable<Entry<String,String>> entries) { String instanceZkTimeoutValue = null; for (Entry<String,String> entry : entries) { String key = entry.getKey(); String value = entry.getValue(); Property prop = Property.getPropertyByKey(entry.getKey()); if (prop == null && Property.isValidPropertyKey(key)) continue; else if (prop == null) log.warn(PREFIX + "unrecognized property key (" + key + ")"); else if (prop.getType() == PropertyType.PREFIX) fatal(PREFIX + "incomplete property key (" + key + ")"); else if (!prop.getType().isValidFormat(value)) fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ") : " + value); if (key.equals(Property.INSTANCE_ZK_TIMEOUT.getKey())) { instanceZkTimeoutValue = value; } if (key.equals(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX.getKey()) || key.equals(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey())) { long bsize = ConfigurationTypeHelper.getFixedMemoryAsBytes(value); Preconditions.checkArgument(bsize > 0 && bsize < Integer.MAX_VALUE, key + " must be greater than 0 and less than " + Integer.MAX_VALUE + " but was: " + bsize); } if (key.equals(Property.INSTANCE_CRYPTO_SERVICE.getKey())) { String cryptoStrategy = Objects.requireNonNull(value); verifyValidClassName(key, cryptoStrategy, CryptoService.class); } } if (instanceZkTimeoutValue != null) { checkTimeDuration(Property.INSTANCE_ZK_TIMEOUT, instanceZkTimeoutValue, new CheckTimeDurationBetween(1000, 300000)); } }  static void validate(Iterable<Entry<String,String>> entries);  }### Answer:
@Test public void testPass() { m.put(Property.MASTER_CLIENTPORT.getKey(), "9999"); m.put(Property.MASTER_TABLET_BALANCER.getKey(), "org.apache.accumulo.server.master.balancer.TableLoadBalancer"); m.put(Property.MASTER_BULK_RETRIES.getKey(), "3"); ConfigSanityCheck.validate(m.entrySet()); }
@Test public void testPass_Empty() { ConfigSanityCheck.validate(m.entrySet()); }
@Test public void testPass_UnrecognizedValidProperty() { m.put(Property.MASTER_CLIENTPORT.getKey(), "9999"); m.put(Property.MASTER_PREFIX.getKey() + "something", "abcdefg"); ConfigSanityCheck.validate(m.entrySet()); }
@Test public void testPass_UnrecognizedProperty() { m.put(Property.MASTER_CLIENTPORT.getKey(), "9999"); m.put("invalid.prefix.value", "abcdefg"); ConfigSanityCheck.validate(m.entrySet()); }
@Test(expected = SanityCheckException.class) public void testFail_Prefix() { m.put(Property.MASTER_CLIENTPORT.getKey(), "9999"); m.put(Property.MASTER_PREFIX.getKey(), "oops"); ConfigSanityCheck.validate(m.entrySet()); }
@Test(expected = SanityCheckException.class) public void testFail_InstanceZkTimeoutOutOfRange() { m.put(Property.INSTANCE_ZK_TIMEOUT.getKey(), "10ms"); ConfigSanityCheck.validate(m.entrySet()); }
@Test(expected = SanityCheckException.class) public void testFail_badCryptoService() { m.put(Property.INSTANCE_CRYPTO_SERVICE.getKey(), "DoesNotExistCryptoService"); ConfigSanityCheck.validate(m.entrySet()); }
@Test public void testPass_defaultCryptoService() { m.put(Property.INSTANCE_CRYPTO_SERVICE.getKey(), Property.INSTANCE_CRYPTO_SERVICE.getDefaultValue()); ConfigSanityCheck.validate(m.entrySet()); }