title: "Singleton" on JUnit test
body: <p>I have been using have for two years now and now I'm trying to learn TDD (Test-Driven Development) and JUnit, the <a href="http://codingdojo.org/kata/FizzBuzz/" rel="nofollow noreferrer">FizzBuzz Kata</a> looked like a good place to start. So I did it:</p>
  
  <pre><code>public class FizzBuzz {
      public static void main(String[] args) {
          Generator generator = new Generator();
          List&lt;String&gt; numbers = generator.fill(1, 100);
          numbers.forEach( item -&gt; System.out.println(item) );
      }
  }
  </code></pre>
  
  <p>It's works find by now I have a question regarding my <code>GeneratorTest.java</code>:</p>
  
  <pre><code>public class GeneratorTest {
  @Test
  public void checkFizz() {
      //Arrange
      Generator generator = new Generator(); // This line is on every test!
  
      //Act
      final int fizzNumber = 3;
      final int containsFizz = 13;
  
      final String result1 = generator.transform(fizzNumber);
      final String result2 = generator.transform(containsFizz);
  
      // Assert
      assertEquals("Fizz", result1);
      assertEquals("Fizz", result2);
  }
  
  @Test
  public void checkBuzz() {
      //Arrange
      Generator generator = new Generator(); // This line is on every test!
  
      //Act
      final int buzzNumber = 5;
      final int containsBuzz = 52;
  
      final String result1 = generator.transform(buzzNumber);
      final String result2 = generator.transform(containsBuzz);
  
      // Assert
      assertEquals("Buzz", result1);
      assertEquals("Buzz", result2);
  }
  
  @Test
  public void checkFizzBuzz() {
      //Arrange
      Generator generator = new Generator(); // This line is on every test!
  
      //Act
      final int fizzBuzzNumber = 15;
      final int containsFizzBuzz = 53;
  
      final String result1 = generator.transform(fizzBuzzNumber);
      final String result2 = generator.transform(containsFizzBuzz);
  
      // Assert
      assertEquals("FizzBuzz", result1);
      assertEquals("FizzBuzz", result2);
  }
  
  @Test
  public void checkFillSize() {
      //Arrange
      Generator generator = new Generator(); // This line is on every test!
  
      //Act
      final int lowerBound = 2;
      final int upperBound = 100;
      final int expectedSize = upperBound - lowerBound + 1;
      List&lt;String&gt; filledList = generator.fill(lowerBound, upperBound);
  
      //Assert
      assertEquals(expectedSize, filledList.size() );
  }
  
  @Test
  public void checkFillContents() {
      //Arrange
      Generator generator = new Generator(); // This line is on every test!
  
      //Act
      ArrayList&lt;String&gt; expectedList = new ArrayList&lt;&gt;( Arrays.asList("1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "Fizz", "14", "FizzBuzz", "16", "17", "Fizz", "19", "Buzz", "Fizz", "22", "Fizz", "Fizz", "Buzz", "26", "Fizz", "28", "29", "FizzBuzz") ) ;
      List&lt;String&gt; filledList = generator.fill(1, expectedList.size() );
  
      //Assert
      assertEquals(expectedList, filledList);
  }
  
  @Test
  public void checkFillCrossedBounds() {
      //Arrange
      Generator generator = new Generator(); // This line is on every test!
  
      //Act
      final int lowerBound = 100;
      final int upperBound = 1;
      final int expectedSize = 0;
      List&lt;String&gt; filledList = generator.fill(lowerBound, upperBound);
  
      //Assert
      assertEquals(expectedSize, filledList.size() );
  }
  </code></pre>
  
  <p>Is there a way to make a singleton <code>generator</code>? And if so, is it a good practice?</p>
  
  <p>I thought of doing it in the constructor but, I'm not sure if is the "right" way because I'm fairly new to JUnit and TDD.</p>
  
  <p>PS: Greetings from Spain!</p>