Sum of left and right nodes (individually) in a Binary Search Tree
This code works and it seems quite fine.


  If there is an easier method to this problem then I would like to know.


You could do it without a Queue,
using a recursive solution,
if your tree is not too deep to lead to a stack overflow.
But since you need to track two kinds of values,
you would need to accumulate them in a helper object,
for example:

private static class Result {
    private long leftSum;
    private long rightSum;
}

public static void sumOfLeftandRightNodes(Node node, Result result) {
    if (node.left != null) {
        result.leftSum += node.left.value;
        sumOfLeftandRightNodes(node.left, result);
    }
    if (node.right != null) {
        result.rightSum += node.right.value;
        sumOfLeftandRightNodes(node.right, result);
    }
}


You could call this method with:

Result result = new Result();
sumOfLeftandRightNodes(root, result);


One advantage of this method is that the solution will become unit-testable,
thanks to this helper class.
When the above call returns, you could add test cases to validate your solution,
for example:

assertEquals(2, result.leftSum);
assertEquals(19, result.rightSum);


Coding style

I would recommend to make everything private when you can,
and final when you can.
The Node class also has a bit too much vertical spacing:


static class Node {
    Node left;

    Node right;

    int value;



I suggest to write this way:

private static class Node {
    private Node left;
    private Node right;
    private final int value;




In the breadth-first search implementation,
temp for the loop variable is not a great name.
I recommend to rename it to node.