### Question:
GeoGigDataStore extends ContentDataStore implements DataStore { public NodeRef findTypeRef(@NonNull Name typeName, @Nullable Transaction tx) throws NoSuchElementException { final String localName = typeName.getLocalPart(); List<NodeRef> typeRefs = findTypeRefs(tx); NodeRef typeRef = findTypeRef(typeRefs, localName); if (typeRef == null) { throw new NoSuchElementException( String.format("No tree ref matched the name: %s", localName)); } return typeRef; } GeoGigDataStore(@NonNull Repository repository);  GeoGigDataStore(@NonNull Context context); @Override void dispose(); void setCloseOnDispose(boolean close); boolean isCloseOnDispose(); void setHead(@Nullable final String refspec); String getOrFigureOutHead(); @Nullable String getConfiguredHead(); boolean isAllowTransactions(); @Nullable String getCheckedOutBranch(); Context resolveContext(@Nullable Transaction transaction); org.opengis.feature.type.Name getDescriptorName(@NonNull NodeRef treeRef); NodeRef findTypeRef(@NonNull Name typeName, @Nullable Transaction tx); GeogigFeatureStore getFeatureStore(String typeName); @Override void createSchema(SimpleFeatureType featureType); @Override void removeSchema(Name name); @Override void removeSchema(String name); GeogigDiffFeatureSource getDiffFeatureSource(final String typeName, final String oldRoot); GeogigDiffFeatureSource getDiffFeatureSource(final String typeName, final String oldRoot,
            final ChangeType changeType); GeogigDiffFeatureSource getDiffFeatureSource(final String typeName, final String oldRoot,
            final Context oldContext, final ChangeType changeType); Optional<ObjectId> createOrUpdateIndex(String layerName, String... extraAttributes); static Optional<ObjectId> createOrUpdateIndex(Repository repository,
            @Nullable String branchOrHead, String featureTreePath, String... extraAttributes);  }### Answer:
public @Test void testFindTypeRef() throws Exception { NameImpl typeName = new NameImpl(pointsName); final Transaction autoCommit = Transaction.AUTO_COMMIT; final Transaction tx = new DefaultTransaction(); try { dataStore.findTypeRef(typeName, autoCommit); fail("Expected NoSuchElementException"); } catch (NoSuchElementException e) { assertTrue(true); } dataStore.createSchema(GT.adapt(pointsType)); final NodeRef firstRef = dataStore.findTypeRef(typeName, autoCommit); assertNotNull(firstRef); assertEquals(RevTree.EMPTY_TREE_ID, firstRef.getObjectId()); insertAndAdd(points1); commit("commit outside datastore"); final NodeRef secondRef = dataStore.findTypeRef(typeName, autoCommit); assertNotNull(secondRef); assertNotEquals(RevTree.EMPTY_TREE_ID, secondRef.getObjectId()); SimpleFeatureStore store = (SimpleFeatureStore) dataStore.getFeatureSource(typeName); store.setTransaction(tx); store.addFeatures(DataUtilities.collection(GT.adapt(points2))); assertEquals(secondRef, dataStore.findTypeRef(typeName, autoCommit)); final NodeRef txRef = dataStore.findTypeRef(typeName, tx); assertNotNull(txRef); assertNotEquals(secondRef, txRef); tx.commit(); tx.close(); assertEquals(txRef, dataStore.findTypeRef(typeName, autoCommit)); }