title: How to find the vertices of an edge and if either of those is a leaf node a in JUNG Graph?
body: <p>I am working with JUNG Graph. The problem I am working on can be defined as follows:</p>
  
  <blockquote>
    <p>Given a JUNG Graph G={V,E} and an edge E1, find the nodes/vertices
    that  E1 connects and delete the vertex if it is a leaf node.</p>
  </blockquote>
  
  <p>So, there are two parts:</p>
  
  <ol>
  <li>Finding the vertices that are connected by a given edge E1. </li>
  <li>Find if a given vertex is a leaf node?</li>
  </ol>
  
  <p>Are these two operations directly possible in JUNG. If not, can someone suggest an alternate way to achieve the same.</p>