### Question:
FactPartition implements Comparable<FactPartition> { public double getAllTableWeights(ImmutableMap<String, Double> tableWeights) { double weight = 0; Map<String, Double> tblWithoutDBWeghts = new HashMap<>(); for (Map.Entry<String, Double> entry : tableWeights.entrySet()) { tblWithoutDBWeghts.put(entry.getKey().substring(entry.getKey().indexOf('.') + 1), entry.getValue()); } for (String tblName : getStorageTables()) { Double tblWeight = tblWithoutDBWeghts.get(tblName); if (tblWeight != null) { weight += tblWeight; } } return weight; } FactPartition(String partCol, Date partSpec, UpdatePeriod period,
    FactPartition containingPart, DateFormat partFormat);  FactPartition(String partCol, Date partSpec, UpdatePeriod period, FactPartition containingPart,
    DateFormat partFormat, Set<String> storageTables);  FactPartition(String partCol, TimePartition timePartition);  FactPartition(String partCol, TimePartition timePartition, FactPartition containingPart, Set<String>
    storageTables); FactPartition withoutContaining(); boolean hasContainingPart(); String getFormattedPartSpec(); FactPartition previous(); FactPartition next(); String getPartString(); String getFormattedFilter(String tableName); String getFormattedFilter(String partCol, String tableName); String getFilter(); @Override String toString(); int compareTo(FactPartition o); TimePartition getTimePartition(); double getAllTableWeights(ImmutableMap<String, Double> tableWeights);  }### Answer:
@Test public void testGetAllTableWeights() throws Exception { Map<String, Double> weights = Maps.newHashMap(); assertEquals(fp1.getAllTableWeights(ImmutableMap.copyOf(weights)), 0.0); weights.put("st1", 0.2); weights.put("st2", 0.3); assertEquals(fp1.getAllTableWeights(ImmutableMap.copyOf(weights)), 0.5); weights.clear(); weights.put("db1.st1", 0.4); weights.put("db2.st2", 0.5); assertEquals(fp1.getAllTableWeights(ImmutableMap.copyOf(weights)), 0.9); }