4343import java .util .Comparator ;
4444import java .util .HashMap ;
4545import java .util .List ;
46- import java .util .Map ;
4746import java .util .Set ;
4847import java .util .TreeMap ;
4948import java .util .TreeSet ;
@@ -91,9 +90,7 @@ public class EntityFinder {
9190 public static List <EntityInfo > findPolyEntities (List <List <Chain >> polyModels ) {
9291 TreeMap <String ,EntityInfo > chainIds2entities = findEntitiesFromAlignment (polyModels );
9392
94- List <EntityInfo > entities = findUniqueEntities (chainIds2entities );
95-
96- return entities ;
93+ return findUniqueEntities (chainIds2entities );
9794 }
9895
9996 /**
@@ -102,7 +99,7 @@ public static List<EntityInfo> findPolyEntities(List<List<Chain>> polyModels) {
10299 */
103100 private static List <EntityInfo > findUniqueEntities (TreeMap <String ,EntityInfo > chainIds2entities ) {
104101
105- List <EntityInfo > list = new ArrayList <EntityInfo >();
102+ List <EntityInfo > list = new ArrayList <>();
106103
107104 for (EntityInfo cluster :chainIds2entities .values ()) {
108105 boolean present = false ;
@@ -131,12 +128,7 @@ public static void createPurelyNonPolyEntities(List<List<Chain>> nonPolyModels,
131128 // let's find first the max entity id to assign entity ids to the newly found entities
132129 int maxMolId = 0 ;
133130 if (!entities .isEmpty ()) {
134- maxMolId = Collections .max (entities , new Comparator <EntityInfo >() {
135- @ Override
136- public int compare (EntityInfo o1 , EntityInfo o2 ) {
137- return new Integer (o1 .getMolId ()).compareTo (o2 .getMolId ());
138- }
139- }).getMolId ();
131+ maxMolId = Collections .max (entities , Comparator .comparingInt (EntityInfo ::getMolId )).getMolId ();
140132 }
141133 // we go one over the max
142134 int molId = maxMolId + 1 ;
@@ -181,7 +173,6 @@ public int compare(EntityInfo o1, EntityInfo o2) {
181173
182174 }
183175
184-
185176 }
186177
187178 private static EntityInfo findNonPolyEntityWithDescription (String description , List <EntityInfo > nonPolyEntities ) {
@@ -221,7 +212,6 @@ private static boolean areResNumbersAligned(Chain c1, Chain c2) {
221212 } catch (StructureException e ) {
222213 // the group doesn't exist (no density) in the chain, go on
223214 countNonExisting ++;
224- continue ;
225215 }
226216 }
227217
0 commit comments