/guava/guava/src/com/google/common/graph/AbstractBaseGraph.java
return IntMath.saturatedAdd( 3.contains( ) , selfLoopCount) ;
return IntMath.saturatedAdd ( neighbors.size ( ) , selfLoopCount ) ;
public int degree(N node) { if (isDirected()) { return IntMath.saturatedAdd(predecessors(node).size(), successors(node).size()); } else { Set<N> neighbors = adjacentNodes(node); int selfLoopCount = (allowsSelfLoops() && neighbors.contains(node)) ? 1 : 0; <extra_id_0> } } @Override public int inDegree(N node) { return isDirected() ? predecessors(node).size() : degree(node); }