def METHOD_NAME(self):
    bqm = oj.BinaryQuadraticModel(self.h, self.J, vartype='SPIN', sparse=False)
    dense_ising_graph,offset = bqm.get_cxxjij_ising_graph()
    bqm = oj.BinaryQuadraticModel(self.h, self.J, vartype='SPIN', sparse=True)
    sparse_ising_graph,offset = bqm.get_cxxjij_ising_graph()
    spins = {0: -1, 1: -1, 2: -1, 3: -1}
    self.assertAlmostEqual(dense_ising_graph.calc_energy([spins[i] for i in range(len(spins))]), bqm.energy(spins))
    self.assertAlmostEqual(sparse_ising_graph.calc_energy([spins[i] for i in range(len(spins))]), bqm.energy(spins))