public static @CheckForNull String getCauseOfBlockage(@NonNull FlowNode stage, @Nullable FlowNode nodeBlock) {
        if(nodeBlock != null){
            //Check and see if this node block is inside this stage
            for(FlowNode p:nodeBlock.getParents()){
                if(p.equals(stage)){
                    Queue.Item item = QueueItemAction.getQueueItem(nodeBlock);
                    if (item != null) {
                        CauseOfBlockage causeOfBlockage = item.getCauseOfBlockage();
                        String cause = null;
                        if (causeOfBlockage != null) {
                            cause = causeOfBlockage.getShortDescription();
                            if (cause == null) {
                                causeOfBlockage = item.task.getCauseOfBlockage();
                                if(causeOfBlockage != null) {
                                    return causeOfBlockage.getShortDescription();
                                }
                            }
                        }
                        return cause;
                    }
                }
            }
        }
        return null;
    }
@Test
    public void getCauseOfBlockage() throws Exception {
        CauseOfBlockage blockage = mock(CauseOfBlockage.class);
        CauseOfBlockage taskBlockage = mock(CauseOfBlockage.class);

        FlowNode stage = mock(FlowNode.class);
        FlowNode nodeBlock = mock(FlowNode.class);
        Queue.Item item = mock(Queue.Item.class);
        mockStatic(QueueItemAction.class);
        String cause = null;

        cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
        assertNull(cause);

        when(nodeBlock.getParents()).thenReturn(Collections.emptyList());
        cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
        assertNull(cause);

        when(nodeBlock.getParents()).thenReturn(Collections.singletonList(stage));
        when(QueueItemAction.getQueueItem(nodeBlock)).thenReturn(null);
        cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
        assertNull(cause);

        when(QueueItemAction.getQueueItem(nodeBlock)).thenReturn(item);
        when(item.getCauseOfBlockage()).thenReturn(null);
        cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
        assertNull(cause);

        when(blockage.getShortDescription()).thenReturn("test");
        when(item.getCauseOfBlockage()).thenReturn(blockage);
        cause = PipelineNodeUtil.getCauseOfBlockage(stage, nodeBlock);
        assertEquals("test", cause);

        when(blockage.getShortDescription()).thenReturn(null);
        cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
        assertNull(cause);

        when(taskBlockage.getShortDescription()).thenReturn("test1");
        Whitebox.setInternalState(item,"task", mock(Queue.Task.class));
        when(item.task.getCauseOfBlockage()).thenReturn(taskBlockage);
        cause = PipelineNodeUtil.getCauseOfBlockage(stage, nodeBlock);
        assertEquals("test1", cause);
    }