code: @NonNull
      public static BeaconManager getInstanceForApplication(@NonNull Context context) {
          /*
           * Follow double check pattern from Effective Java v2 Item 71.
           *
           * Bloch recommends using the local variable for this for performance reasons:
           *
           * > What this variable does is ensure that `field` is read only once in the common case
           * > where it's already initialized. While not strictly necessary, this may improve
           * > performance and is more elegant by the standards applied to low-level concurrent
           * > programming. On my machine, [this] is about 25 percent faster than the obvious
           * > version without a local variable.
           *
           * Joshua Bloch. Effective Java, Second Edition. Addison-Wesley, 2008. pages 283-284
           */
          BeaconManager instance = sInstance;
          if (instance == null) {
              synchronized (SINGLETON_LOCK) {
                  instance = sInstance;
                  if (instance == null) {
                      sInstance = instance = new BeaconManager(context);
                  }
              }
          }
          return instance;
      }
docs: An accessor for the singleton instance of this class.  A context must be provided, but if you need to use it from a non-Activity
  or non-Service class, you can attach it to another singleton or a subclass of the Android Application class.