Driver Code
public static void main ( String [ ] args ) { ArrayList < ArrayList < Integer > > rectangle = new ArrayList < ArrayList < Integer > > ( ) ; ArrayList < ArrayList < Integer > > points = new ArrayList < ArrayList < Integer > > ( ) ; ArrayList < ArrayList < Integer > > triangle = new ArrayList < ArrayList < Integer > > ( ) ; rectangle . add ( new ArrayList < Integer > ( Arrays . asList ( 6 , 5 ) ) ) ; rectangle . add ( new ArrayList < Integer > ( Arrays . asList ( 2 , 2 ) ) ) ; rectangle . add ( new ArrayList < Integer > ( Arrays . asList ( 2 , 1 ) ) ) ; rectangle . add ( new ArrayList < Integer > ( Arrays . asList ( 5 , 5 ) ) ) ; points . add ( new ArrayList < Integer > ( Arrays . asList ( 1 , 1 ) ) ) ; points . add ( new ArrayList < Integer > ( Arrays . asList ( 6 , 1 ) ) ) ; points . add ( new ArrayList < Integer > ( Arrays . asList ( 6 , 6 ) ) ) ; points . add ( new ArrayList < Integer > ( Arrays . asList ( 1 , 6 ) ) ) ; triangle . add ( new ArrayList < Integer > ( Arrays . asList ( 4 , 4 ) ) ) ; triangle . add ( new ArrayList < Integer > ( Arrays . asList ( 0 , 4 ) ) ) ; triangle . add ( new ArrayList < Integer > ( Arrays . asList ( 0 , - 2 ) ) ) ; countPoints ( points , triangle , rectangle ) ; } }