### Question:
BiasItemVectorNormalizer extends AbstractItemVectorNormalizer { @Override public InvertibleFunction<Long2DoubleMap, Long2DoubleMap> makeTransformation(long itemId, Long2DoubleMap vector) { return new Transform(itemId); } @Inject  BiasItemVectorNormalizer(BiasModel bias); @Override InvertibleFunction<Long2DoubleMap, Long2DoubleMap> makeTransformation(long itemId, Long2DoubleMap vector);  }### Answer:
@Test public void testNormalizeVectorForUser() { InvertibleFunction<Long2DoubleMap, Long2DoubleMap> tx = normalizer.makeTransformation(42L, Long2DoubleMaps.EMPTY_MAP); Long2DoubleMap vec = new Long2DoubleOpenHashMap(); vec.put(1L, 3.0); vec.put(2L, 3.5); vec.put(3L, 4.0); Long2DoubleMap out = tx.apply(vec); assertThat(out.get(1L), closeTo(3.0 - 3.0 - 0.5 - 0.2, 0.0001)); assertThat(out.get(2L), closeTo(3.5 - 3.0 - 0.5 + 0.1, 0.0001)); assertThat(out.get(3L), closeTo(4.0 - 3.0 - 0.5, 0.0001)); }
@Test public void testDenormalizeVectorForUser() { InvertibleFunction<Long2DoubleMap, Long2DoubleMap> tx = normalizer.makeTransformation(42L, Long2DoubleMaps.EMPTY_MAP); Long2DoubleMap vec = new Long2DoubleOpenHashMap(); vec.put(1L, -1.0); vec.put(2L, -0.5); vec.put(3L, 0.2); Long2DoubleMap out = tx.unapply(vec); assertThat(out.get(1L), closeTo(-1.0 + 3.0 + 0.5 + 0.2, 0.0001)); assertThat(out.get(2L), closeTo(-0.5 + 3.0 + 0.5 - 0.1, 0.0001)); assertThat(out.get(3L), closeTo(0.2 + 3.0 + 0.5, 0.0001)); }