@Nullable
  private static <K, T> Map.Entry<K, T> findFirstInMapByKey(Map<K, T> map, Predicate<K> keyMatch) {
    return map.entrySet().stream()
        .filter(entry -> keyMatch.test(entry.getKey()))
        .findFirst()
        .orElse(null);
  }
Returns the first entry matching the given key predicate.
jib-core/src/main/java/com/google/cloud/tools/jib/registry/credentials/DockerConfig.java