Create Observable interface for FeedObservable

PiperOrigin-RevId: 250743713
Change-Id: Iaabb3e28469ed2e6126db398fb6d95c23bece93f
diff --git a/src/main/java/com/google/android/libraries/feed/common/feedobservable/FeedObservable.java b/src/main/java/com/google/android/libraries/feed/common/feedobservable/FeedObservable.java
index 927b53f..428843f 100644
--- a/src/main/java/com/google/android/libraries/feed/common/feedobservable/FeedObservable.java
+++ b/src/main/java/com/google/android/libraries/feed/common/feedobservable/FeedObservable.java
@@ -19,12 +19,13 @@
 import java.util.Set;
 
 /** Provides methods for registering or unregistering arbitrary observers. */
-public abstract class FeedObservable<ObserverT> {
+public abstract class FeedObservable<ObserverT> implements Observable<ObserverT> {
   private static final String TAG = "FeedObservable";
 
   protected final Set<ObserverT> observers = new HashSet<>();
 
   /** Adds given {@code observer}. No-op if the observer has already been added. */
+  @Override
   public void registerObserver(ObserverT observer) {
     synchronized (observers) {
       if (!observers.add(observer)) {
@@ -34,6 +35,7 @@
   }
 
   /** Removes given {@code observer}. No-op if the observer is not currently added. */
+  @Override
   public void unregisterObserver(ObserverT observer) {
     synchronized (observers) {
       if (!observers.remove(observer)) {
diff --git a/src/main/java/com/google/android/libraries/feed/common/feedobservable/Observable.java b/src/main/java/com/google/android/libraries/feed/common/feedobservable/Observable.java
new file mode 100644
index 0000000..cd69a91
--- /dev/null
+++ b/src/main/java/com/google/android/libraries/feed/common/feedobservable/Observable.java
@@ -0,0 +1,25 @@
+// Copyright 2019 The Feed Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.android.libraries.feed.common.feedobservable;
+
+/** Allows for registering and unregistering observers */
+public interface Observable<ObserverT> {
+
+  /** Register a new observer. If already registered, will have no effect. */
+  void registerObserver(ObserverT observer);
+
+  /** Unregister an observer. If not registered, will have no effect. */
+  void unregisterObserver(ObserverT observer);
+}