public static Map<String, Object> coerceTypes(
      final Map<String, Object> streamsProperties,
      final boolean ignoreUnresolved
  ) {
    if (streamsProperties == null) {
      return Collections.emptyMap();
    }

    final Map<String, Object> validated = new HashMap<>(streamsProperties.size());
    for (final Map.Entry<String, Object> e : streamsProperties.entrySet()) {
      try {
        validated.put(e.getKey(), coerceType(e.getKey(), e.getValue()));
      } catch (final PropertyNotFoundException p) {
        if (ignoreUnresolved) {
          validated.put(e.getKey(), e.getValue());
        } else {
          throw p;
        }
      }
    }
    return validated;
  }
@Test
  public void shouldThrowOnUnkownPropertyFromCoerceTypes() {
    // given/when:
    assertThrows(
        PropertyNotFoundException.class,
        () -> PropertiesUtil.coerceTypes(ImmutableMap.of("foo", "bar"), false)
    );
  }