### Question:
GaussianProposalDistribution implements ProposalDistribution { @Override public Proposal getProposal(Set<? extends Variable> variables, KeanuRandom random) { Proposal proposal = new Proposal(); for (Variable variable : variables) { if (!(variable.getValue() instanceof DoubleTensor)) { throw new IllegalStateException("Gaussian proposal function cannot be used for discrete variable " + variable); } if (!sigmas.containsKey(variable)) { throw new IllegalStateException("A sigma was not specified for variable " + variable); } DoubleTensor sample = random.nextGaussian(variable.getShape(), (DoubleTensor) variable.getValue(), sigmas.get(variable)); proposal.setProposal(variable, sample); } proposalNotifier.notifyProposalCreated(proposal); return proposal; } GaussianProposalDistribution(List<? extends Variable> variables, DoubleTensor sigma);  GaussianProposalDistribution(List<? extends Variable> variables, DoubleTensor sigma, List<ProposalListener> listeners);  GaussianProposalDistribution(Map<? extends Variable, DoubleTensor> sigmas);  GaussianProposalDistribution(Map<? extends Variable, DoubleTensor> sigmas, List<ProposalListener> listeners); @Override Proposal getProposal(Set<? extends Variable> variables, KeanuRandom random); @Override double logProb(Probabilistic<T> variable, T ofValue, T givenValue); @Override void onProposalRejected();  }### Answer:
@Test public void itThrowsIfYouUseItOnADiscreteVariable() { thrown.expect(IllegalStateException.class); thrown.expectMessage("Gaussian proposal function cannot be used for discrete variable"); PoissonVertex poisson = new PoissonVertex(1.); proposalDistribution.getProposal(ImmutableSet.of(poisson), KeanuRandom.getDefaultRandom()); }
@Test public void getProposalThrowsIfProposalIsMissingASigmaForAVariable() { CauchyVertex notInProposalDistribution = new CauchyVertex(1., 1.); thrown.expect(IllegalStateException.class); thrown.expectMessage("A sigma was not specified for variable " + notInProposalDistribution); proposalDistribution.getProposal(ImmutableSet.of(notInProposalDistribution), KeanuRandom.getDefaultRandom()); }