@@ -0,0 +1,1115 @@
+// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.%0Apackage com.yahoo.vespa.flags;%0A%0Aimport com.yahoo.vespa.flags.json.FlagData;%0Aimport com.yahoo.vespa.flags.json.Rule;%0A%0Aimport java.util.Map;%0Aimport java.util.Optional;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0A/**%0A * Basic in-memory flag source useful for testing%0A *%0A * @author freva%0A */%0Apublic class InMemoryFlagSource implements FlagSource %7B%0A    private final Map%3CFlagId, FlagData%3E flagDataById = new ConcurrentHashMap%3C%3E();%0A%0A    public InMemoryFlagSource withFlag(FlagId flagId) %7B%0A        flagDataById.put(flagId, new FlagData(flagId));%0A        return this;%0A    %7D%0A%0A    public InMemoryFlagSource withFlag(FlagId flagId, FetchVector defaultFetchVector, Rule... rules) %7B%0A        flagDataById.put(flagId, new FlagData(flagId, defaultFetchVector, rules));%0A        return this;%0A    %7D%0A%0A    @Override%0A    public Optional%3CRawFlag%3E fetch(FlagId id, FetchVector vector) %7B%0A        return Optional.ofNullable(flagDataById.get(id))%0A                .flatMap(flagData -%3E flagData.resolve(vector));%0A    %7D%0A%7D%0A

Add basic InMemoryFlagSource