@Test public void testPrintSelfAddress() throws Exception { Assert.assertEquals(10, infiniteRecursion.printSelfAddress(10)); }
public int printSelfAddress(int size) { ArrayList<InfiniteRecursion> infiniteRecursions = new ArrayList<InfiniteRecursion>(); for (int i = 0; i < size; i++) { infiniteRecursions.add(new InfiniteRecursion()); } System.out.println(infiniteRecursions); return size; }
InfiniteRecursion { public int printSelfAddress(int size) { ArrayList<InfiniteRecursion> infiniteRecursions = new ArrayList<InfiniteRecursion>(); for (int i = 0; i < size; i++) { infiniteRecursions.add(new InfiniteRecursion()); } System.out.println(infiniteRecursions); return size; } }
InfiniteRecursion { public int printSelfAddress(int size) { ArrayList<InfiniteRecursion> infiniteRecursions = new ArrayList<InfiniteRecursion>(); for (int i = 0; i < size; i++) { infiniteRecursions.add(new InfiniteRecursion()); } System.out.println(infiniteRecursions); return size; } InfiniteRecursion(); }
InfiniteRecursion { public int printSelfAddress(int size) { ArrayList<InfiniteRecursion> infiniteRecursions = new ArrayList<InfiniteRecursion>(); for (int i = 0; i < size; i++) { infiniteRecursions.add(new InfiniteRecursion()); } System.out.println(infiniteRecursions); return size; } InfiniteRecursion(); int printSelfAddress(int size); @Override String toString(); }
InfiniteRecursion { public int printSelfAddress(int size) { ArrayList<InfiniteRecursion> infiniteRecursions = new ArrayList<InfiniteRecursion>(); for (int i = 0; i < size; i++) { infiniteRecursions.add(new InfiniteRecursion()); } System.out.println(infiniteRecursions); return size; } InfiniteRecursion(); int printSelfAddress(int size); @Override String toString();  }