/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package doublex.lib.lockableContainers;

/**
 *
 * @author DoubleX
 * @param <C>
 * @param <K>
 */
public final class UnitTestedLockableContainer<C, K> {

    private final LockableContainer<C, K> mLockableContainer;

    public UnitTestedLockableContainer(
            final LockableContainer<C, K> lockableContainer) {
        mLockableContainer = lockableContainer;
    }

    public final void tryPutContents(final C contents) {
        System.out.println(
                "UnitTestedLockableContainer tryPutContents contents: " + 
                        contents);
        mLockableContainer.tryPutContents(contents);
    }

    public final C triedTakenContents() {
        final C contents = mLockableContainer.triedTakenContents();
        System.out.println("UnitTestedLockableContainer triedTakenContents");
        if (mLockableContainer.mLocks.isLocked() && contents != null) {
            System.out.println("Failed! Actual value: " + contents);
        } else {
            System.out.println(
                    "At least nothing can be taken from a locked container!");
        }
        return contents;
    }

}

@@ -219,16 +219,82 @@
 iners;%0A%0A
+import java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0A
 /**%0A *%0A 
@@ -396,17 +396,159 @@
 r%3CC, K%3E 
-%7B
+implements IContainable%3CC%3E %7B%0A%0A    private static final Logger LOG = %0A            Logger.getLogger(UnitTestedLockableContainer.class.getName());
 %0A%0A    pr
@@ -766,28 +766,36 @@
  %7D%0A%0A    
+@Override%0A    
 public
- final
  void tr
@@ -839,127 +839,31 @@
     
-System.out.println(%0A                %22UnitTestedLockableContainer tryPutContents contents: %22 + %0A                        
+unitTestTryPutContents(
 cont
@@ -933,28 +933,36 @@
  %7D%0A%0A    
+@Override%0A    
 public
- final
  C tried
@@ -1059,129 +1059,125 @@
     
-System.out.println(%22UnitTestedLockableContainer triedTakenC
+unitTestTriedTakenContents(contents);%0A        return c
 ontents
-%22)
 ;%0A    
+%7D%0A%0A
     
-if (mLockableContainer.mLocks.isLocked() &&
+private void unitTestTryPutContents(final C
  con
@@ -1185,16 +1185,8 @@
 ents
- != null
 ) %7B%0A
@@ -1197,66 +1197,72 @@
     
-  
-  System.out.println(%22Failed! Actual value: %22 + c
+LOG.log(Level.INFO, %22UnitTestedLockableContainer tryPutC
 ontents
+%22
 );%0A 
@@ -1272,152 +1272,250 @@
     
-%7D else %7B
+LOG.log(Level.INFO, %22contents: %7B0%7D%22, contents);
 %0A    
+%7D%0A%0A
     
-    System.out.println(%0A                    %22At least nothing can be taken from a locked container!%22);%0A        %7D%0A        return
+private void unitTestTriedTakenContents(final C contents) %7B%0A        LOG.log(Level.INFO, %22UnitTestedLockableContainer triedTakenContents%22);%0A        LOG.log(Level.INFO, %22contents: %7B0%7D%22,
  con
@@ -1519,19 +1519,20 @@
 contents
+)
 ;%0A    %7D%0A
 %0A%7D%0A
@@ -1528,11 +1528,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Update UnitTestedLockableContainer.java