### Question:
UniformIntVertex extends VertexImpl<IntegerTensor, IntegerVertex> implements IntegerVertex, ProbabilisticInteger, SamplableWithManyScalars<IntegerTensor>, LogProbGraphSupplier { @Override public LogProbGraph logProbGraph() { IntegerPlaceholderVertex valuePlaceholder = new IntegerPlaceholderVertex(this.getShape()); IntegerPlaceholderVertex minPlaceholder = new IntegerPlaceholderVertex(min.getShape()); IntegerPlaceholderVertex maxPlaceholder = new IntegerPlaceholderVertex(max.getShape()); return LogProbGraph.builder() .input(this, valuePlaceholder) .input(min, minPlaceholder) .input(max, maxPlaceholder) .logProbOutput(UniformInt.logProbOutput(valuePlaceholder, minPlaceholder, maxPlaceholder)) .build(); } UniformIntVertex(@LoadShape long[] shape,
                            @LoadVertexParam(MIN_NAME) Vertex<IntegerTensor, ?> min,
                            @LoadVertexParam(MAX_NAME) Vertex<IntegerTensor, ?> max);  UniformIntVertex(long[] shape, int min, int max);  UniformIntVertex(long[] shape, IntegerTensor min, IntegerTensor max);  UniformIntVertex(long[] shape, Vertex<IntegerTensor, ?> min, int max);  UniformIntVertex(long[] shape, int min, Vertex<IntegerTensor, ?> max); @ExportVertexToPythonBindings  UniformIntVertex(Vertex<IntegerTensor, ?> min, Vertex<IntegerTensor, ?> max);  UniformIntVertex(Vertex<IntegerTensor, ?> min, int max);  UniformIntVertex(int min, Vertex<IntegerTensor, ?> max);  UniformIntVertex(int min, int max); @SaveVertexParam(MIN_NAME) IntegerVertex getMin(); @SaveVertexParam(MAX_NAME) IntegerVertex getMax(); @Override double logProb(IntegerTensor value); @Override LogProbGraph logProbGraph(); @Override Map<Vertex, DoubleTensor> dLogProb(IntegerTensor value, Set<? extends Vertex> withRespectTo); @Override IntegerTensor sampleWithShape(long[] shape, KeanuRandom random);  }### Answer:
@Test public void logProbGraphUpperBoundIsNegativeInfinity() { IntegerVertex min = ConstantVertex.of(IntegerTensor.create(lowerBound, new long[]{1, N})); IntegerVertex max = ConstantVertex.of(IntegerTensor.create(upperBound, new long[]{1, N})); UniformIntVertex testUniformVertex = new UniformIntVertex(min, max); LogProbGraph logProbGraph = testUniformVertex.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, min, min.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, max, max.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, testUniformVertex, IntegerTensor.scalar(upperBound)); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, Double.NEGATIVE_INFINITY); }
@Test public void logProbGraphLowerBoundIsNotNegativeInfinity() { IntegerVertex min = ConstantVertex.of(IntegerTensor.create(lowerBound, new long[]{1, N})); IntegerVertex max = ConstantVertex.of(IntegerTensor.create(upperBound, new long[]{1, N})); UniformIntVertex testUniformVertex = new UniformIntVertex(min, max); LogProbGraph logProbGraph = testUniformVertex.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, min, min.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, max, max.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, testUniformVertex, IntegerTensor.scalar(lowerBound)); UniformIntegerDistribution uniformIntegerDistribution = new UniformIntegerDistribution(lowerBound, upperBound - 1); double expectedDensity = Math.log(uniformIntegerDistribution.probability(lowerBound)) * N; LogProbGraphContract.matchesKnownLogDensity(logProbGraph, expectedDensity); }