@@ -0,0 +1,1696 @@
+// Copyright 2019 Google LLC%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//     https://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.sps;%0A%0Aimport com.google.cloud.vision.v1.AnnotateImageRequest;%0Aimport com.google.cloud.vision.v1.AnnotateImageResponse;%0Aimport com.google.cloud.vision.v1.BatchAnnotateImagesResponse;%0Aimport com.google.cloud.vision.v1.EntityAnnotation;%0Aimport com.google.cloud.vision.v1.Image;%0Aimport com.google.cloud.vision.v1.ImageAnnotatorClient;%0Aimport com.google.sps.data.ShoppingListTextEntry;%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class FakeTextDetectionAPIImpl implements TextDetectionAPI %7B%0A    %0A  public List%3CShoppingListTextEntry%3E detect(byte%5B%5D imageBytes) throws PhotoDetectionException %7B%0A      List%3CShoppingListTextEntry%3E results = new ArrayList%3C%3E();%0A      if(imageBytes.length == 0) %7B%0A          throw new PhotoDetectionException(%22Invalid imageBytes%22);%0A      %7D%0A      else if(imageBytes.length %3C 10) %7B%0A          results.add(ShoppingListTextEntry.create(%22Grey boots for men%22, 100));%0A      %7D%0A      else if(imageBytes.length %3E 10) %7B%0A          results.add(ShoppingListTextEntry.create(%22Blue shirt for women%22, 98));%0A      %7D%0A      return results;%0A  %7D%0A%7D%0A

Add fake impl