### Question:
TechId implements Serializable { public Technology inDatabase(EDatabase database) { return database.getTech(this); } TechId(IdManager idManager, String techName, int techIndex); synchronized LayerId newLayerId(String layerName); synchronized ArcProtoId newArcProtoId(String arcProtoName); synchronized PrimitiveNodeId newPrimitiveNodeId(String primitiveNodeName); Technology inDatabase(EDatabase database); String toString(); static boolean jelibSafeName(String str); static final TechId[] NULL_ARRAY; final IdManager idManager; final String techName; final int techIndex; }### Answer:
@Test public void inDatabase() { System.out.println("inDatabase"); EDatabase database = new EDatabase(idManager.getInitialSnapshot()); assertNull(techId2.inDatabase(database)); TechId genericId = idManager.newTechId("generic"); assertNull(genericId.inDatabase(database)); }
@Test(expected = NullPointerException.class) public void inDatabaseNull() { System.out.println("inDatabaseNull"); techId2.inDatabase(null); }