In this paper, we consider the energy allocation problem for energy harvesting and energy cooperating nodes with finite-sized batteries. In particular, we solve the sum-throughput maximization problem in a two-way channel with energy harvesting nodes that can also transfer energy to one another. To do so, we non-trivially extend a class of policies which originally rely on an infinite-sized battery to be optimal, to the finite battery case. We observe that when we partition transferred energy into immediately used and stored components, an optimal policy has a non-zero stored component only when the battery of the transferring user is full. This enables the decomposition of the sum-throughput maximization problem into separate energy transfer and power allocation problems. Utilizing properties of this optimal class of policies, we solve the power allocation problem using a two dimensional directional water-filling algorithm with restricted transfers, where energy transfers only take place at full battery instances. Numerical results demonstrate that energy cooperation notably improves sum-throughput as one node gets energy deprived.