@@ -0,0 +1,1450 @@
+/*%0A * Copyright 2021 The Bazel Authors. All rights reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.google.idea.blaze.base.model;%0A%0Aimport com.google.idea.blaze.base.model.primitives.Label;%0Aimport com.intellij.openapi.project.Project;%0Aimport java.util.Optional;%0Aimport org.jetbrains.annotations.Nullable;%0A%0A/**%0A * Allows to pass a target name during instance creation and then will always resolve to that target%0A * name.%0A */%0Apublic final class FakeLibraryToTargetResolver implements LibraryToTargetResolver %7B%0A%0A  @Nullable private final Label label;%0A%0A  private FakeLibraryToTargetResolver(@Nullable Label label) %7B%0A    this.label = label;%0A  %7D%0A%0A  public static FakeLibraryToTargetResolver create(@Nullable Label label) %7B%0A    return new FakeLibraryToTargetResolver(label);%0A  %7D%0A%0A  @Override%0A  public Optional%3CLabel%3E resolveLibraryToTarget(Project project, LibraryKey library) %7B%0A    return Optional.ofNullable(label);%0A  %7D%0A%7D%0A

Make FakeLibraryToTargetResolver OpenSource