FileSystemClassInformationRepository implements ClassInformationRepository { @Override public ClassInformation getInformation(String internalClassName) { Validate.notNull(internalClassName); return hierarchyMap.get(internalClassName); }  static FileSystemClassInformationRepository create(List<File> initialClasspath); @Override ClassInformation getInformation(String internalClassName); void addIndividual(String className, ClassInformation classInformation); void addClasspath(List<File> classpath);  }
@Test public void mustGetClassInformationForInteger() { ClassInformation info = repo.getInformation("fake/java/lang/Integer"); assertEquals("fake/java/lang/Number", info.getSuperClassName()); assertEquals(1, info.getInterfaces().size()); assertTrue(info.getInterfaces().contains("fake/java/lang/Comparable")); assertFalse(info.isInterface()); }
@Test public void mustGetClassInformationForBoolean() { ClassInformation info = repo.getInformation("fake/java/lang/Boolean"); assertEquals("java/lang/Object", info.getSuperClassName()); assertEquals(2, info.getInterfaces().size()); assertTrue(info.getInterfaces().contains("fake/java/lang/Comparable")); assertTrue(info.getInterfaces().contains("fake/java/io/Serializable")); assertFalse(info.isInterface()); }
@Test public void mustGetClassInformationForRunnableFuture() { ClassInformation info = repo.getInformation("fake/java/util/concurrent/RunnableFuture"); assertEquals("java/lang/Object", info.getSuperClassName()); assertEquals(2, info.getInterfaces().size()); assertTrue(info.getInterfaces().contains("fake/java/lang/Runnable")); assertTrue(info.getInterfaces().contains("fake/java/util/concurrent/Future")); assertTrue(info.isInterface()); }
@Test public void mustFailToGetClassInformationForUnknownClass() { ClassInformation info = repo.getInformation("2huowhf9w37fy9fhnwfwfwefasef"); assertNull(info); }