### Question:
IndividualExtractor implements ValueVisitor { @Override public void visitIndividual(Individual<?, ?> value) { if(this.clazz.isInstance(value)) { this.value = clazz.cast(value); } } private  IndividualExtractor(final Class<? extends S> clazz); @Override void visitLiteral(Literal<?> value); @Override void visitIndividual(Individual<?, ?> value);  }### Answer:
@Test public void testVisitIndividual() throws Exception { Individual<ManagedIndividualId, ?> individual = exampleDataSet().individualOfId(managedIndividualId(RESOURCE_NAME.id(), MANAGER_ID)); IndividualExtractor<ManagedIndividualId, ManagedIndividual> sut = IndividualExtractor.newInstance(ManagedIndividual.class); sut.visitIndividual(individual); assertThat(sut.isAvailable(),equalTo(true)); assertThat((Object)sut.getValue(),sameInstance((Object)individual)); }
@Test public void testVisitIndividual$null() throws Exception { Individual<ManagedIndividualId, ?> individual = exampleDataSet().individualOfId(managedIndividualId(RESOURCE_NAME.id(), MANAGER_ID)); @SuppressWarnings("rawtypes") IndividualExtractor<Name, LocalIndividual> sut = IndividualExtractor.newInstance(LocalIndividual.class); sut.visitIndividual(individual); assertThat(sut.isAvailable(),equalTo(false)); assertThat(sut.getValue(),nullValue()); }