package org.joda.time;

import java.util.HashMap;

public class Pool {

    private static Pool myInstance;
    private HashMap<Integer, Days> days;
    private HashMap<Integer, Minutes> minutes;

    private Pool() {
        this.days = new HashMap<Integer, Days>();
        this.minutes = new HashMap<Integer, Minutes>();
    }

    public static Pool getInstance() {

        if (myInstance == null) {
            myInstance = new Pool();
        }

        return myInstance;
    }

    private void addDay(int numeral, Days day) {
        days.put(new Integer(numeral), day);
    }



    public static Days retrieveDays(int numeral) {
        Pool pool = Pool.getInstance();

        Object result = pool.getDays(numeral);

        if (result == null) {
            result =  new Days(numeral);
            pool.addDay(numeral, (Days) result);
        }

        return (Days) result;
    }


    public static Minutes retrieveMinutes(int numeral) {

        Pool pool = Pool.getInstance();

        Object result = pool.getMinutes(numeral);

        if (result == null) {
            result =  new Minutes(numeral);
            pool.addMinutes(numeral, (Minutes) result);
        }

        return (Minutes) result;
    }

    private void addMinutes(int numeral, Minutes minute) {
        minutes.put(new Integer(numeral), minute);
    }


    private Object getDays(int numeral){
        Object instance = days.get(new Integer(numeral));

        return instance;

    }

    private Object getMinutes(int numeral) {
        Object instance = minutes.get(new Integer(numeral));

        return instance;
    }
}

@@ -484,111 +484,8 @@
  %7D%0A%0A
-    private void addDay(int numeral, Days day) %7B%0A        days.put(new Integer(numeral), day);%0A    %7D%0A%0A%0A%0A
     
@@ -1112,32 +1112,133 @@
  result;%0A    %7D%0A%0A
+    private void addDay(int numeral, Days day) %7B%0A        days.put(new Integer(numeral), day);%0A    %7D%0A%0A
     private void
@@ -1276,24 +1276,24 @@
 s minute) %7B%0A
-
         minu
@@ -1334,25 +1334,24 @@
 te);%0A    %7D%0A%0A
-%0A
     private 
@@ -1430,32 +1430,32 @@
 ger(numeral));%0A%0A
+
         return i
@@ -1463,17 +1463,16 @@
 stance;%0A
-%0A
     %7D%0A%0A 

move addDay to private methods zone and fix code format