public Set<Action> getDependencies(Action a) {
        if (!demandingNodes.containsKey(a)) {
            return Collections.emptySet();
        }
        Node n = demandingNodes.get(a);
        Set<Action> allActions = getFreeings(n);
        Set<Action> pre = new HashSet<>();
        for (Action action : allActions) {
            if (!action.equals(a) && a.getStart() >= action.getEnd()) {
                pre.add(action);
            }
        }
        return pre;
    }
public Set < Action > getDependencies ( Action a ) { if ( ! demandingNodes . containsKey ( a ) ) { return Collections . emptySet ( ) ; } Node n = demandingNodes . get ( a ) ; Set < Action > allActions = getFreeings ( n ) ; Set < Action > pre = new HashSet < > ( ) ; for ( Action action : allActions ) { if ( ! action . equals ( a ) && a . getStart ( ) >= action . getEnd ( ) ) { pre . add ( action ) ; } } return pre ; }
Get the dependencies for an action.

@param a the action to check
@return its dependencies, may be empty