class Prefser {

  public <T> void put(@NonNull String key, @NonNull T value) {
    Preconditions.checkNotNull(value, VALUE_IS_NULL);
    put(key, value, TypeToken.fromValue(value));
  }

}

class PrefserTest {

  private static final String GIVEN_KEY;
  private static final String GIVEN_STRING_VALUE;
  private static final String KEY_WHICH_DOES_NOT_EXIST;
  private Prefser prefser;

  @Test(expected = NullPointerException.class)
  public void testPutShouldThrowAnExceptionWhenKeyAndValueAreNullForPut() {

    // given
    String key = null;
    String value = null;

    // when
    prefser.put(key, value);

    // then
    // throw an exception
  }

}