public static boolean overlaps ( final Map . Entry < Double , Double > first , final Map . Entry < Double , Double > second ) { return second . getValue ( ) > first . getKey ( ) && second . getKey ( ) < first . getValue ( ) ; }
Method to check if two segment overlaps .