@Test
public void testGetUnusedBindingNumber() {

  final PipelineInfo pipelineInfo = new PipelineInfo();
  assertEquals(pipelineInfo.getUnusedBindingNumber(), 0);
  // Adds three uniforms with binding numbers 0, 1 and 2.
  pipelineInfo.addUniform("A", BasicType.INT, Optional.of(0), new ArrayList<>());
  pipelineInfo.addUniformBinding("A", false,
      pipelineInfo.getUnusedBindingNumber());
  assertEquals(pipelineInfo.getBinding("A"), 0);
  assertEquals(pipelineInfo.getUnusedBindingNumber(), 1);
  pipelineInfo.addUniform("B", BasicType.INT, Optional.of(0), new ArrayList<>());
  pipelineInfo.addUniformBinding("B", false,
      pipelineInfo.getUnusedBindingNumber());
  assertEquals(pipelineInfo.getBinding("B"), 1);
  assertEquals(pipelineInfo.getUnusedBindingNumber(), 2);
  pipelineInfo.addUniform("C", BasicType.INT, Optional.of(0), new ArrayList<>());
  pipelineInfo.addUniformBinding("C", false,
      pipelineInfo.getUnusedBindingNumber());
  assertEquals(pipelineInfo.getBinding("C"), 2);
  assertEquals(pipelineInfo.getUnusedBindingNumber(), 3);
  // Removes the centermost uniform and checks that the next added uniform has the same
  // binding number.
  pipelineInfo.removeUniform("B");
  assertEquals(pipelineInfo.getUnusedBindingNumber(), 1);
  pipelineInfo.addUniform("D", BasicType.INT, Optional.of(0), new ArrayList<>());
  pipelineInfo.addUniformBinding("D", false,
      pipelineInfo.getUnusedBindingNumber());
  assertEquals(pipelineInfo.getBinding("D"), 1);
  assertEquals(pipelineInfo.getUnusedBindingNumber(), 3);
}