@Test
public void getStringCollection_throwsExceptionOnNonCollectionProperty() {

  Configuration config = new Configuration();
  HadoopConfigurationProperty<String> stringKey =
      new HadoopConfigurationProperty<>("actual.key", "default-string");
  HadoopConfigurationProperty<Integer> integerKey =
      new HadoopConfigurationProperty<>("actual.key", 1);
  HadoopConfigurationProperty<Collection<String>> collectionKey =
      new HadoopConfigurationProperty<>("collection.key", ImmutableList.of("key1", "key2"));
  assertThrows(IllegalStateException.class, () -> stringKey.getStringCollection(config));
  assertThrows(IllegalStateException.class, () -> integerKey.getStringCollection(config));
  assertThat(collectionKey.getStringCollection(config)).containsExactly("key1", "key2").inOrder();
}