<commit_before>package specs;

import static com.greghaskins.spectrum.Spectrum.describe;
import static com.greghaskins.spectrum.Spectrum.it;
import static com.greghaskins.spectrum.Spectrum.value;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

import com.greghaskins.spectrum.Spectrum;
import com.greghaskins.spectrum.Spectrum.Value;

import org.junit.runner.RunWith;

@RunWith(Spectrum.class)
public class MutableWrapperSpec {
  {

    describe("The Value convenience type", () -> {

      it("allows you to set the value of a 'final' variable", () -> {
        final Value<Integer> counter = value();
        counter.value = 0;
        counter.value = 1;
        assertThat(counter.value, is(1));
      });

      it("can be given a starting value", () -> {
        final Value<Double> pi = value(3.14);
        assertThat(pi.value, is(3.14));
      });

      it("has a default value of null if not specified", () -> {
        final Value<String> name = value();
        assertThat(name.value, is(nullValue()));
      });

    });
  }
}<commit_msg>Make sure tests cover deprecated value(Class<T>) method<commit_after>package specs;

import static com.greghaskins.spectrum.Spectrum.describe;
import static com.greghaskins.spectrum.Spectrum.it;
import static com.greghaskins.spectrum.Spectrum.value;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

import com.greghaskins.spectrum.Spectrum;
import com.greghaskins.spectrum.Spectrum.Value;

import org.junit.runner.RunWith;

@RunWith(Spectrum.class)
@SuppressWarnings("deprecation")
public class MutableWrapperSpec {
  {

    describe("The Value convenience type", () -> {

      it("allows you to set the value of a 'final' variable", () -> {
        final Value<Integer> counter = value();
        counter.value = 0;
        counter.value = 1;
        assertThat(counter.value, is(1));
      });

      it("can be given a starting value", () -> {
        final Value<Double> pi = value(3.14);
        assertThat(pi.value, is(3.14));
      });

      it("has a default value of null if not specified", () -> {
        final Value<String> name = value();
        assertThat(name.value, is(nullValue()));
      });

      it("can take an explicit class parameter, for backward compatibility with ~0.6.1", () -> {
        final Value<String> stringValue = value(String.class);
        assertThat(stringValue.value, is(nullValue()));
      });

    });
  }
}
{'fraction_non_alphanumeric': 0.13243243243243244, 'fraction_numerical': 0.008108108108108109, 'mean_word_length': 3.3039867109634553, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6805263', 'n_tokens_mistral': 815, 'n_tokens_neox': 774, 'n_words': 186}