public RuntimeImpl( String activeEnv, Map<String, ? extends Machine> machines, String owner, String machineToken, List<? extends Command> commands, List<? extends Warning> warnings) { this.activeEnv = activeEnv; if (machines != null) { this.machines = machines .entrySet() .stream() .collect( toMap( Map.Entry::getKey, entry -> new MachineImpl(entry.getKey(), entry.getValue()))); } this.owner = owner; this.machineToken = machineToken; if (commands != null) { this.commands = commands.stream().map(CommandImpl::new).collect(toCollection(ArrayList::new)); } if (warnings != null) { this.warnings = warnings.stream().map(WarningImpl::new).collect(toList()); } }