public MachineImpl( String name, Map<String, String> attributes, Map<String, ? extends Server> servers, MachineStatus status) { this.name = name; this.attributes = new HashMap<>(attributes); this.status = status; if (servers != null) { this.servers = servers .entrySet() .stream() .collect( HashMap::new, (map, entry) -> map.put(entry.getKey(), new ServerImpl(entry.getKey(), entry.getValue())), HashMap::putAll); } }