<commit_before>package scala.tools.eclipse.util
import org.junit.Test

class CachedTest {

  val reentrant: Cached[Int] = new Cached[Int] {
    def create() = {
      println("in create")
      reentrant(x => x + 1)
    }

    def destroy(x: Int) {
    }
  }

  @Test(expected = classOf[RuntimeException]) def testDeadlock {
    reentrant { x =>
      println("in testDeadlock")
      x + 1
    }
  }
}<commit_msg>Added successful test for Cached.<commit_after>package scala.tools.eclipse.util
import org.junit.Test
import junit.framework.Assert

class CachedTest {

  val reentrant: Cached[Int] = new Cached[Int] {
    def create() = {
      reentrant(x => x + 1)
    }

    def destroy(x: Int) {
    }
  }

  @Test(expected = classOf[RuntimeException]) def testDeadlock {
    reentrant { x =>
      x + 1
    }
  }
  
  @Test def testCorrectInit {
    val testVal = new Cached[Int] {
      def create() = {
        42
      }
      
      def destroy(x: Int) {
        
      }
    }
    
    Assert.assertEquals("Initialized value", 42, testVal(x => x))
  }
}
{'fraction_non_alphanumeric': 0.12429378531073447, 'fraction_numerical': 0.007532956685499058, 'mean_word_length': 2.2808641975308643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6891467', 'n_tokens_mistral': 382, 'n_tokens_neox': 365, 'n_words': 82}