VariablesSupport implements Variables, EventAware { @Override @Nullable public Object get(final String name) { checkNotNull(name); return map.get(name); } VariablesSupport(final Map<String, Object> map);  VariablesSupport(); @Inject void setEventManager(final EventManager eventManager); @Override void set(final String name, @Nullable final Object value); @Override void set(final String name, @Nullable final Object value, boolean mutable); @Override void set(final Class<?> type, @Nullable final Object value); @Override @Nullable Object get(final String name); @Override @Nullable @SuppressWarnings({"unchecked"}) T get(final String name, final Class<T> type); @Override @Nullable T get(final String name, final Class<T> type, @Nullable final T defaultValue); @Override @Nullable T get(final Class<T> type, @Nullable final T defaultValue); @Override @Nullable T get(final Class<T> type); @Override @Nullable Object get(final String name, @Nullable final Object defaultValue); @Override Object require(final String name); @Override Object require(final String name, final Object defaultValue); @Override T require(final String name, final Class<T> type, final T defaultValue); @Override T require(final String name, final Class<T> type); @Override T require(final Class<T> type, final T defaultValue); @Override T require(final Class<T> type); @Override void unset(final String name); @Override void unset(final Class<?> type); @Override boolean contains(final String name); @Override boolean contains(final Class<?> type); @Override Iterable<String> names(); @Override Map<String,Object> asMap();  }
@Test public void testGetUsingDefault() throws Exception { String name = "a"; Object value = new Object(); Object obj1 = underTest.get(name); assertNull(obj1); Object obj2 = underTest.get(name, value); assertSame(value, obj2); }
@Test public void testGet() throws Exception { String name = "a"; Object value = new Object(); Object obj1 = underTest.get(name); assertNull(obj1); underTest.set(name, value); Object obj2 = underTest.get(name); assertSame(value, obj2); }