code: private static EventListener toEntryListener(Object implementation) {
          if (implementation instanceof EntryListener) {
              return (EventListener) implementation;
          }
  
          if (implementation instanceof MapListener) {
              return new MapListenerToEntryListenerAdapter((MapListener) implementation);
          }
  
          throw new IllegalArgumentException(implementation + " is not an expected EventListener implementation."
                  + " A valid one has to be an implementation of EntryListener or MapListener");
  
      }
docs: This method provides a workaround by converting a MapListener to EntryListener
  when it is added via EntryListenerConfig object.
  <p>
  With this method, we are trying to fix two problems :
  First, if we do not introduce the conversion in this method, {@link EntryListenerConfig#getImplementation}
  will give {@link ClassCastException} with a MapListener implementation.
  <p>
  Second goal of the conversion is to preserve backward compatibility.