VectorizerUtils { public static float[] randomVector(int aSize, long seed) { Random rand = new Random(seed); float[] unk = new float[aSize]; for (int i = 0; i < unk.length; i++) { unk[i] = (rand.nextFloat() - 0.5f) / aSize; } return unk; }  static float[] randomVector(int aSize, long seed); static float[] randomVector(int aSize);  }
@Test public void testRandomVectorStable() throws IOException { float[] unk1 = VectorizerUtils.randomVector(3); float[] unk2 = VectorizerUtils.randomVector(3); assertTrue("Random vector for unknown words should always be the same.", Arrays.equals(unk1, unk2)); }