/*-
 * -\-\-
 * Spotify Styx Common
 * --
 * Copyright (C) 2016 - 2019 Spotify AB
 * --
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * -/-/-
 */

package com.spotify.styx.util;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import org.junit.Test;

public class MaybeCachedValueTest {

  @Test
  public void createShouldAssignProperties() {
    testFor(true, 1);
    testFor(false, 2);
  }

  public void testFor(boolean expectedCache, int expectedValue) {
    MaybeCachedValue<Integer> maybeCacheValue = MaybeCachedValue.create(expectedCache, expectedValue);

    assertThat(maybeCacheValue.isCached(), equalTo(expectedCache));
    assertThat(maybeCacheValue.value(), equalTo(expectedValue));
  }
}
@@ -785,229 +785,658 @@
 ort 
-org.junit.Test;%0A%0Apublic class MaybeCachedValueTest %7B%0A%0A  @Test%0A  public void createShouldAssignProperties() %7B%0A    testFor(true, 1);%0A    testFor(false, 2);%0A  %7D%0A%0A  public void testFor(boolean expectedC
+java.util.Arrays;%0Aimport java.util.Collection;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0A@RunWith(Parameterized.class)%0Apublic class MaybeCachedValueTest %7B%0A%0A  @Parameterized.Parameters(name = %22%7Bindex%7D: create(%7B0%7D, %7B1%7D)%22)%0A  public static Collection%3CObject%5B%5D%3E data() %7B%0A    return Arrays.asList(new Object%5B%5D%5B%5D %7B%0A        %7B false, 0 %7D, %7B true, 1 %7D, %7B false, 2 %7D, %7B true, 3 %7D%0A    %7D);%0A  %7D%0A%0A  private boolean cached;%0A  private int value;%0A%0A  public MaybeCachedValueTest(boolean c
 ache
+d
 , int 
-expectedValue
+value) %7B%0A    this.cached = cached;%0A    this.value = value;%0A  %7D%0A%0A  @Test%0A  public void createShouldAssignProperties(
 ) %7B%0A
@@ -1511,32 +1511,17 @@
 ate(
-expectedC
+c
 ache
+d
 , 
-expectedV
+v
 alue
@@ -1579,21 +1579,14 @@
 lTo(
-expectedC
+c
 ache
+d
 ));%0A
@@ -1637,17 +1637,9 @@
 lTo(
-expectedV
+v
 alue

Rework test to make it parametrized